Any quick way to generate coordinates (by 3or more independent variables) and plot them?

I can plot this p=[u;v;0]; using ezmesh(p(1),p(2),p(3),[0,2,0,2],10);
but how to plot this? p=[u;v;t]; for all u,v,t =0:0.1:1 Is that i have to use for loops for each point and plot them out one by one?

回答 (2 件)

Honglei Chen
Honglei Chen 2012 年 4 月 30 日

0 投票

These two are a little different. ezmesh treats the first 3 inputs as functions, so the fact you have three scalars there just means that they are constant functions. On the other hand, when all your inputs are vectors, ezmesh does not know how to interpret them. The question is really what you want because your u,v,t are all vectors. Are they specifying a curve in 3D space? If you want to use a mesh plot, then you t should be a function of u and v, i.e., you need to have a value of t for each combination of u and v.

2 件のコメント

sty2004
sty2004 2012 年 4 月 30 日
Sorry about the confusion of using mesh as an example. I just want to know is there a built-in function that can plot points in 3d space which uses functions of more than 2 variables.
Honglei Chen
Honglei Chen 2012 年 4 月 30 日
Does scatter3 or plot3 serve your needs?
Sean de Wolski
Sean de Wolski 2012 年 4 月 30 日

0 投票

Yes:
If you have a function, f, that accepts (x,y,z) and returns V, you can plot this using: isosurface() or slice() amongst others.

この質問は閉じられています。

タグ

質問済み:

2012 年 4 月 30 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by