From making 2D line plots to making 3D surface plots: How to preserve my current workflow?
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
- I would like to continue looping through beta;
- To keep things organized and de-cluttered, I would like to continue calling my functions which are stored in separate files;
- For doing careful mathematics, I would like to continue expressing vectors as linear combinations of basis vectors; and
- I would like to keep all the functions to be plotted scalar-valued.
採用された回答
29 件のコメント
Hi Star Strider!
Yes the third coordinate of ip and jp is zero; my problem is quasi-2D.
The issue is, say I have this
velocity = vx * ip + vy * jp,
where vx = cos(beta)*sin(alpha),
and vy is something similar.
The surface plot will be against beta and alpha, so I write
beta = linspace(0,pi,20)
alpha = (0,pi/2,100).
But now, vx * ip gives the error that arrays are incompatible.
Sorry for the late response: I think I’ll loop through Beta?
Set theta = 0, since my model is invariant to changes in theta.

Hi Star Strider!
Can I loop through both beta and alpha? Also, my function is in a separate function file, which my surface plotting code calls. Does this cause issues? Should I instead keep my function locally defined within my surface plotting code? Thanks!
Hi Star Strider,
For making surface plots, I have to use Beta and Alpha, the outputs from meshgrid(alpha, beta), as inputs to the functions. But before I get to the functions I want to code up terms, which are vectors, as linear combinations of rotating basis vectors. Matlab is telling me about arrays having incompatible sizes, when I try to do this, because Beta is a vector, Alpha is a vector, and a rotating basis vector is a vector. This is tricky to get right, in contrast to making simple line plots, where I didn’t have much issues. I’m a little frustrated with myself. I’m going to try again tomorrow. Goodnight, and thanks for your time!
- I would like to continue looping through beta;
- To keep things organized and de-cluttered, I would like to continue calling my functions which are stored in separate files; and
- For doing careful mathematics, I would like to continue expressing vectors as linear combinations of basis vectors, etc.


その他の回答 (1 件)

カテゴリ
ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索
タグ
参考
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)
