Index exceeds the number of array elements (35).
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Stephen23
2019년 11월 19일
편집: Stephen23
2019년 11월 19일
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
Stephen23
2019년 11월 19일
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
2019년 11월 19일
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!