フィルターのクリア

How to plot different length vectors against each other?

4 ビュー (過去 30 日間)
Keshav
Keshav 2023 年 12 月 6 日
コメント済み: Steven Lord 2023 年 12 月 6 日
I've used ode45 to find t against x and t against y. The plot I want to create is of x against y.
However the x vector has a length of 113 compared to 1849 for y because of the differences in timestep.
Is there a way to interpolate and plot(x,y)? Or perhaps to specify that ode45 creates more x values.

採用された回答

Torsten
Torsten 2023 年 12 月 6 日
移動済み: Torsten 2023 年 12 月 6 日
However the x vector has a length of 113 compared to 1849 for y because of the differences in timestep.
Solve for x and y together in one call to ode45. Then the solutions for x and y will have the same number of elements.
  1 件のコメント
Steven Lord
Steven Lord 2023 年 12 月 6 日
Or if you must solve them in separate calls to ode45, either pass the times from the first as the tspan in the second call or call them each with one output and use the deval function on that struct output to evaluate the solutions at a common list of times.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by