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.

 Akzeptierte Antwort

Star Strider
Star Strider am 6 Sep. 2015
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

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by