4D plot in Matlab

2 ビュー (過去 30 日間)
Manisha Bajaj
Manisha Bajaj 2019 年 5 月 14 日
コメント済み: Manisha Bajaj 2019 年 5 月 20 日
I have x,y,z as 3 axes & A is a matrix whose elements corresponds to for each point of x,y,z. How to plot A w.r.t. x,y & z axis?
  3 件のコメント
Manisha Bajaj
Manisha Bajaj 2019 年 5 月 16 日
z = 9.5 for all coordinates
x = -3.5:1:4.5
y = 1.5:1:9.5
for Z=9.5
x --> -3.5 -2.5 -1.5 -0.5 0.5 1.5 2.5 3.5 4.5
y
1.5 0.7 0.8 0.7 0.9 0.8 0.8 0.7 0.7 0.8
2.5 0.8 0.8 0.7 0.9 0.7 0.7 0.9 0.8 0.9
3.5 0.8 1 0.9 0.9 0.9 0.9 1 0.8 0.9
4.5 0.7 0.9 0.8 0.9 0.7 0.8 0.8 0.8 0.8
5.5 0.7 0.9 0.6 0.7 0.7 0.9 0.7 0.8 0.9
6.5 0.7 0.8 0.8 0.7 0.8 0.7 0.6 0.6 0.7
7.5 0.7 0.9 0.7 0.7 1 0.6 0.6 0.7 0.8
8.5 0.8 1 0.8 0.8 0.9 0.6 0.7 0.6 0.8
9.5 0.7 0.8 0.8 1 0.8 0.7 0.8 0.8 0.7
Manisha Bajaj
Manisha Bajaj 2019 年 5 月 20 日
Thankyou so much for your response but this doesnt work for my data.. can you share some other idea?

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

回答 (2 件)

KSSV
KSSV 2019 年 5 月 16 日
[X,Y,Z] = peaks(100) ;
surf(X,Y,Z,Z)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2019 年 5 月 16 日
Hi Manisha,
Based on your given data sets (assuming that some large parts of data belong to [A] as shown below from XY). So you have x, y, z vs. A. In this case surf() would be the good option:
XY = [1.5 0.7 0.8 0.7 0.9 0.8 0.8 0.7 0.7 0.8 ;
2.5 0.8 0.8 0.7 0.9 0.7 0.7 0.9 0.8 0.9 ;
3.5 0.8 1 0.9 0.9 0.9 0.9 1 0.8 0.9 ;
4.5 0.7 0.9 0.8 0.9 0.7 0.8 0.8 0.8 0.8;
5.5 0.7 0.9 0.6 0.7 0.7 0.9 0.7 0.8 0.9 ;
6.5 0.7 0.8 0.8 0.7 0.8 0.7 0.6 0.6 0.7 ;
7.5 0.7 0.9 0.7 0.7 1 0.6 0.6 0.7 0.8 ;
8.5 0.8 1 0.8 0.8 0.9 0.6 0.7 0.6 0.8 ;
9.5 0.7 0.8 0.8 1 0.8 0.7 0.8 0.8 0.7 ];
X =[-3.5 -2.5 -1.5 -0.5 0.5 1.5 2.5 3.5 4.5 ];
Y = XY(:, 1)'; % or Y =1.5:1:9.5;
for ii = 1:numel(X)
x(ii,:)=[X];
y(ii,:) =[Y];
end
z = 9.5*ones(9,9);
A = XY(:, 2:end); % 1st column is Y and the rest [A], right?
surf(x, y, z, A), axis tight; shg
Good luck.

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by