4D plot of 3 vectors and 3D array

조회 수: 1 (최근 30일)
Dillon Esposito-Kelley
Dillon Esposito-Kelley 2021년 3월 31일
댓글: Abdullah 2023년 11월 8일
I have a 3D array that is dependent on the variables of 3 different vectors. I am trying to make a plot with the axises being the vectors and likely color being the 3D array. Each vector is 10 long and the 3D array is a 10,10,10 array of values that are not a direct equation from the vectors.
  댓글 수: 3
Dillon Esposito-Kelley
Dillon Esposito-Kelley 2021년 3월 31일
Its not velocity vectors, the 3 vectors are pressure, length, diameter, and the 3D array is cost. I want a graph to show the cost for each combintation of length diameter and pressure and the cost associated with that combination.
Chad Greene
Chad Greene 2021년 3월 31일

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

채택된 답변

Meg Noah
Meg Noah 2021년 4월 1일
In this project, I show a couple of 3D vis techniques
Try:
[Ny,Nx,Nz] = size(data);
[x3d,y3d,z3d] = meshgrid(1:Nx,1:Ny,1:Nz);
s = data; % this if you want to normalize it -> 0.5*(data(:)-mean(data(:)))/std(data(:))+0.5;
s(s<0) = nan;
% s(s>1) = 1; % this is useful if you normalize it
figure();
hs = scatter3(x3d(:),y3d(:),z3d(:),0.5*s(:), ...
s(:),'filled','MarkerEdgeColor','none', ...
'MarkerFaceAlpha',0.05), view(-60,60);
axis equal
axis tight
  댓글 수: 1
Abdullah
Abdullah 2023년 11월 8일
is there a way to process this function if the data includes negative values?
Scatter3 can not used with negative values
and surface can not be used with vector
i do not know how i can show the data

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-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