Convering 4 data vectors into 3d matrix

조회 수: 1 (최근 30일)
AHMED ADEL ALY IBRAHIM
AHMED ADEL ALY IBRAHIM 2022년 4월 6일
편집: Tala 2022년 4월 7일
Hi, I have three vectors like this x=[1,2,3,1], y=[1,2,3,2] and z=[1,2,3,3] and a forth vector v=[10,15,20,25] which is dependant on x,y and z.
is there a way to make a 3D matrix representing the value of v in the space of x,y,z?
thanks!

답변 (1개)

Tala
Tala 2022년 4월 6일
You can use the fourth dimension as colormap. take a look at this. in your example you could use:
x=[1,2,3,1];
y=[1,2,3,2];
z=[1,2,3,3];
v=[10,15,20,25] ;
scatter3(x,y,z,40,v,'filled') % draw the scatter plot
view(-31,14)
  댓글 수: 2
AHMED ADEL ALY IBRAHIM
AHMED ADEL ALY IBRAHIM 2022년 4월 7일
Thank you!
this helped to view the vector v in 3D plan. However my need is to represent the vector v in a 3*3 matrix form ?
Tala
Tala 2022년 4월 7일
편집: Tala 2022년 4월 7일
I am bot sure if I understand the problem. You have x,y,z which are 1x4 and V which is 3x3. Your array dimensions should match before plotting

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by