Plotting data from a 4D cell.

6 vues (au cours des 30 derniers jours)
ErikaZ
ErikaZ le 3 Août 2018
Modifié(e) : ErikaZ le 19 Fév 2020
I have a 4D cell with the following sizes A{17,10,16,10}(2,3). However, it only contains data on:
% A{d,sw,hLS,cv}
d= [4 5 6 7 8 9 10 13 17];
sw = [1 2 4 6 8 10];
hLS=[2 4 6 8 10 12 14 16];
cv=1:10;
I would like to plot all the values of
A{4:17,1:10,2:16,1}(1,1)
in a 4D surface where
x= d
y= sw
z= hLS
values of A = color
This is the first time working with 4D cells and I have only plotted 2D plots.
I know there are the commands meshgrid(), surf(), scatter3() but I do not know how to apply them and how to format/extract my data. I was thinking of either doing a slanted/diamond/pryamid surface were hLS =16 is the highest points and hLS = 2 the lowest points. Or a 8 slices for the 8 levels of hLS.
Thanks!
  1 commentaire
AliAlemana
AliAlemana le 14 Nov 2018
Dear ErikaZ,
did you manage to solve the problem? I have a similar issue and I was wondering if your answer might help me.
Thanks!

Connectez-vous pour commenter.

Réponse acceptée

ErikaZ
ErikaZ le 19 Fév 2020
Modifié(e) : ErikaZ le 19 Fév 2020
% A{d,sw,hLS} A was averaged over cv first
layers=[2 6 10 16];
A([1:3,11,12,14:16],:,:)=[]; A(:,[3,5,7,9],:)=[];
function Plot4D( SGRAM,layers,last_layer)
hls=[1:last_layer];
pi=[1:9];
sw=[1:6];
[SW,PI,HLS] = meshgrid(sw,pi,hls);
SWslice = [];
PIslice = [];
HLSslice = layers;
surfHandless = slice(SW,PI,HLS,SGRAM,SWslice,PIslice,HLSslice);
end

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by