How to plot a 51*51*51 array
Mostra commenti meno recenti
Hi, i'm a newbie of this community.I'm sorry for any next mistakes.For my thesis of dinamical of the structrures at university i have to calculate the pressure into an acustic hole.Here is the scripts for the calcus of this pressure in every point of the hole.the hole is a box with this dimensions(pi,2,1).i divided it into a grid of 51x51x51 points.
n_nod=51; %%%number of nodes for each side x=linspace(0,pi,n_nod); y=linspace(0,2,n_nod); z=linspace(0,1,n_nod);
r_int=zeros(n_nod,n_nod,n_nod);
Ppr=zeros(n_nod,n_nod,n_nod);
for i=1:1:n_nod for j=1:1:n_nod for h=1:1:n_nod
r_int(i,j,h)=((0.5-x(i))^2+(1.5-y(j))^2+(1.5-z(h))^2)^0.5;
Ppr(i,j,h)=1/(2*pi*r_int(i,j,h));
end
end
end
the script generate an array Ppr of 51x51x51 elements.I'd like to plot Ppr in a 3D graph in different colour in fuction of the each points. which command can add to the script to do this??? thanks to all for any answer!
Risposte (3)
Azzi Abdelmalek
il 23 Nov 2012
Modificato: Azzi Abdelmalek
il 23 Nov 2012
mesh(Ppr(:,:,1),Ppr(:,:,2),Ppr(:,:,3))
6 Commenti
Azzi Abdelmalek
il 23 Nov 2012
what is the size of Ppr. type
size(Ppr)
desah
il 23 Nov 2012
Azzi Abdelmalek
il 23 Nov 2012
Then it should work
Azzi Abdelmalek
il 23 Nov 2012
I can't tell what do you want to plot? Can you precize what do you want to plot, what are x, y and z
Michael scheinfeild
il 9 Lug 2014
0 voti
i think you need to look at volume visualization functions like figure,slice(Ppr,x,y,z)
Categorie
Scopri di più su Statistics and Machine Learning Toolbox in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!