can not get values
Ältere Kommentare anzeigen
i built this mathimaticly project of tram running simulation , but there is no error and at the same time there is no output values (all values are zero), would u please help me and diagnose the matter ?
Akzeptierte Antwort
Weitere Antworten (1)
Mark Sherstan
am 29 Jan. 2019
Your data set and interplation dont line up. The R variable you define is:
R =
379 24
1000 56
1180 110
1300 72
2360 1170
2990 328
6200 154
6320 192
9149 283
Looking at the first couple loops t will be 1, 2, 3, ...
interp1(R(:,1),R(:,2),t)
t has nothing to interpolate to. It is not bounded by any values and will output "nan" which forces your if statment:
if interp1(R(:,1),R(:,2),t)>0
R=interpl(R(:,1),R(:,2),t);
wR=600*m*g/(R-55);
else
wR=0;
end
To output a zero answer. Try fixing up your data sets and solve the first couple itterations by hand to make sure everything makes sense.
Kategorien
Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!