Ploting vector data in 2D or 3D

1 回表示 (過去 30 日間)
josef vahab
josef vahab 2016 年 10 月 4 日
コメント済み: josef vahab 2016 年 10 月 4 日
Hello everybody, I have three vectors in MATLAB. The first vectors is x-axis values like X= [ 1 2 3 5....], the second vector is y-axis values and the same size of x, like y=[1 5 4 8 9 ...] and the third vector is my data at each (x,y) point with the same size of X or Y vector like data=[ 2 5 6 1 ...]. Thus, for example, data(n) corresponds to x(n) and y(n). My question is how can I plot my data vector at x and y points? I prefer to see the result in color format (similar to what imagesc gives).
  2 件のコメント
Joe Yeh
Joe Yeh 2016 年 10 月 4 日
josef vahab
josef vahab 2016 年 10 月 4 日
Thanks for ur response. quiver(x,y,u,v) cannot plot it because u and v should be a matrix. But in my case I have only u (not v) which is a vector not a matrix.

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

回答 (1 件)

gubertoli
gubertoli 2016 年 10 月 4 日
You can try:
plot3(x,y,z)
  1 件のコメント
josef vahab
josef vahab 2016 年 10 月 4 日
This doesn't work for my case since my data, for example x-Axis values, are not arranged in order. Trying plot3(x,y,z), attached figure is the result I have got.

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

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by