Ploting equation and experimental data in the same plot

Hi. I had a very long differential equation and solved it using ode45. Now there is an excel file with experimental data. How can I plot the equation and experimental data in the plot to see if they fit? Thank you.

 채택된 답변

Star Strider
Star Strider 2015년 9월 6일
Use the xlsread function to read the Excel file. Then plot your results on the same axes you plot your ODE solution on.
Hypothetical code might be something like this:
d = xlsread(filename);
time = d(:,1);
data = d(:,2);
. . .
[t,y] = ode45( . . . );
. . .
figure(1)
plot(t, y)
hold on
plot(time, data)
hold off
grid

추가 답변 (0개)

카테고리

질문:

2015년 9월 6일

댓글:

2015년 9월 7일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by