フィルターのクリア

how to add timestep iteration and show all iteration in plot

8 ビュー (過去 30 日間)
Abdulrahman Mohamed
Abdulrahman Mohamed 2022 年 2 月 8 日
コメント済み: Benjamin Thompson 2022 年 2 月 10 日
Alteration

採用された回答

Benjamin Thompson
Benjamin Thompson 2022 年 2 月 8 日
You can use a for loop, using your t0, dt, and tf variables in a vector notation to define the values of the time variable t:
for t = t0:dt:tf
your code...
end
  1 件のコメント
Benjamin Thompson
Benjamin Thompson 2022 年 2 月 10 日
If this question has been answered, please mark it accepted. Users with a higher acceptance rate will get faster and more effective responses for future answers.

サインインしてコメントする。

その他の回答 (1 件)

Arif Hoq
Arif Hoq 2022 年 2 月 8 日
time = [4 50] ;
points = [20 100] ;
% interpolation
step_count = time(1):0.1:time(2) ; % timestep 0.1
expected_points = interp1(time,points,step_count) ;
% plot
plot(time,points,'*r',step_count,expected_points,'-g')
ylim([0 110])

カテゴリ

Help Center および File ExchangeSources についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by