Data plot for different values
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
I want plot theta as a function of z at t = time(nt) for all xi values but receive: Error using plot: Data cannot have more than 2 dimensions om line 140.
採用された回答
Torsten
2022 年 9 月 14 日
%store your outputs for each xi
thetaxivalues(ixi,:,:) = theta(:,:);
vxivalues(ixi,:,:) = v(:,:);
What is ixi ? I guess, it's a single scalar, namely ixi = nxi from the last loop where ixi appears:
for ixi = 1:length(xivalues)
xi = xivalues(ixi);
end
So you don't store outputs for each xi.
8 件のコメント
University Glasgow
2022 年 9 月 14 日
I actually wants the xi to take values from xivalues = linspace(-0.3, -0.1, nxi).
Torsten
2022 年 9 月 14 日
But your vector "theta" does not depend on xi.
So it makes no sense to set
thetaxivalues(1:nxi,:,:) = theta(:,:);
vxivalues(1:nxi,:,:) = v(:,:);
because every vector thetaxivalues and vxivalues will contain the same values for 1 <= ixi <= nxi.
University Glasgow
2022 年 9 月 14 日
You are right but what do you suggest then?
Torsten
2022 年 9 月 14 日
Your simulations must contain xi as a parameter and you must vary this parameter to get theta(xi,:,:) and v(xi,:,:).
University Glasgow
2022 年 9 月 14 日
Please, could you help me out.
How could I ?
I don't know anything about your model, and at the moment, I don't see a variable xi within the equations in lcode1 that could be varied.
University Glasgow
2022 年 9 月 14 日
If you cehck the discretised equations, I have xi in the v equation.
Please check, you will see: (xi/(2*h))*(theta(N-1)-theta(N-3));
Then call the solver in a loop over the elements of xi and write the results in a 3d v and theta array.
But that's really standard and I won't do that for you.
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で MATLAB についてさらに検索
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
