Doubt in a program
4 ビュー (過去 30 日間)
古いコメントを表示
can someone explain line 13,14?
If I remove that I am getting a blank plot

0 件のコメント
採用された回答
Torsten
2023 年 8 月 13 日
編集済み: Torsten
2023 年 8 月 13 日
Why ?
In order to plot a time-location curve after the while-loop, the intermediate results for time and location are saved in two separate vectors.
6 件のコメント
Image Analyst
2023 年 8 月 15 日
Again, it's recommended not to use the name of built-in functions, such as time, as your variable names.
その他の回答 (1 件)
Image Analyst
2023 年 8 月 13 日
編集済み: Image Analyst
2023 年 8 月 13 日
Don't use time as the name of your variable since it's a built-in function. Call it "theTime" or something.
Don't have line 20 - no need to plot twice.
Have lines 13 and 14 come before lines 11 and 12.
Have line 17 say
whos theTime % Display size of vector
whos location
plot(theTime, location, 'r-', 'LineWidth', 2);
grid on;
Post your code as code/text (not an image) if you need any more help after you read this:
2 件のコメント
Image Analyst
2023 年 8 月 14 日
My advice can be followed this time, on this program. No need to wait until next time (next program).
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!