Index exceeds the number of array elements (35).
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
x=0:6
Ta=30.2
To=69.0
k=0.04
e=1.04
y=Ta+(To-Ta)*e.^(x*(-k))
y2=log(y-Ta)
subplot(1,2,1)
plot(x,y)
xlabel=('estimated time--->')
ylabel=('tempertureT--->')
title=('temperature vs estimated time graph')
subplot(1,2,2)
plot(x,y2)
xlabel=('time--->')
ylabel=('log(T-Ta)--->')
title('log(T-Ta) vs time graph')
0 comentarios
Respuestas (1)
Stephen23
el 19 de Nov. de 2019
Editada: Stephen23
el 19 de Nov. de 2019
You have repeatedly used syntax with an = sign, which assigns those values to some variables, e.g:
xlabel=('estimated time--->')
ylabel=('tempertureT--->')
title=('temperature vs estimated time graph')
Whereas I suspect that you really wanted to just call those functions (note: no = sign):
xlabel('estimated time--->')
ylabel('tempertureT--->')
title('temperature vs estimated time graph')
Once you have assigned a variable named title (or xlabel or ylabel or ...) then you will not be able to call the title (or xlabel or ylabel or ...) function.
Solution: call those functions properly, clear your workspace, and try again.
2 comentarios
Stephen23
el 19 de Nov. de 2019
Jeel Khatiwala's "Answer" moved here:
x=0:6
Ta=30.2
To=69.0
k=0.04
e=1.04
y=Ta+(To-Ta)*e.^(x*(-k))
y2=log(y-Ta)
subplot(1,2,1)
plot(x,y)
xlabel=('estimated time--->')
ylabel=('tempertureT--->')
A=('temperature vs estimated time graph')
subplot(1,2,2)
plot(x,y2)
xlabel=('time--->')
ylabel=('log(T-Ta)--->')
title('log(T-Ta) vs time graph')
Stephen23
el 19 de Nov. de 2019
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!