i want to plot the graph for while loop but the graph was blank
조회 수: 1 (최근 30일)
이전 댓글 표시
d=1;
while X>=t
fprintf('Value of T0 at t=%d is %d\n',t,T0);
%compute f(t,T0)
ftT0= f(t,T0);
%compute newTo
newT0= T0+h.*ftT0;
%for printing
rsl(d,:)=[t T0 ftT0 newT0];
%update iteration
d=d+1;
%update t
t= t+h;
%update T0
T0= newT0;
end
plot(t,T0)
답변 (1개)
VBBV
2023년 1월 21일
t(d)= t+h;
%update T0
T0(d)= newT0;
댓글 수: 2
VBBV
2023년 1월 21일
To plot a graph, use a vector of values for the variables by indexing them in a loop
참고 항목
카테고리
Help Center 및 File Exchange에서 Graph and Network Algorithms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!