To plot the model error against time
조회 수: 2 (최근 30일)
이전 댓글 표시
Anyone please help me plot the model error against time in the subplot(212)
V=20;
t_sim=30;
sample_distance=0.2;
ts=sample_distance/V;
collect_ts=ts*1;
t_plot=(0:collect_ts:t_sim);
댓글 수: 1
Image Analyst
2014년 2월 16일
편집: Image Analyst
2014년 2월 16일
Please format your code properly: http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup
채택된 답변
Mischa Kim
2014년 2월 17일
편집: Mischa Kim
2014년 2월 17일
Priya, the "correct" syntax for subplots is:
subplot(2,1,1) % notice the commas
Other than that, what is
size(deltaSignal)
size(percentageDifference)
And finally, I believe what you are trying to do is:
plot(deltaSignal,percentageDifference)
댓글 수: 3
Mischa Kim
2014년 2월 17일
I do not know what exactly your variables mean, I am trying to interpret based on your code and information. It seems that in
deltaSignal = abs(simout_ss(:,19)-simout_b(:,19));
you compute the difference between two signals (models?) and in
percentageDifference=deltaSignal./simout_b(:,19);
you calculate the relative difference ( not percentage; for that you need to multiply the result by 100). So using
plot(t_psim,percentageDifference)
should plot what you are looking for.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Subplots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!