How do I plot a 3D Array in MATLAB?
Afficher commentaires plus anciens
I'm trying to plot a 3D Array which was created by the following. I have gone through similar posts, however this question is not answered yet.
My goal is to plot the Amatrix( 3D array) to show its variation with respect to n1, c1 and c2. Please note the n1, c1 and c2 values are stored in n1matrix, c1matrix and c2matrix.
%%% Initializations %%%%
number_of_simulations = 50;
n1vector = linspace(0.55,10,number_of_simulations);
c1vector = linspace(0.55,10,number_of_simulations);
c2vector = linspace(0.55,10,number_of_simulations);
n1matrix = zeros(length(n1vector), length(c1vector), length(c2vector));
c1matrix = zeros(length(n1vector), length(c1vector), length(c2vector));
c2matrix = zeros(length(n1vector), length(c1vector), length(c2vector));
%%% code for creating Amatrix, n1matrix, c1matrix and c2matrix - all 3D matrices of 50X50X50 (rowXcolumnXpage)
for i=1:length(n1)
n1 = n1vector(i);
for j=1:length(c1)
c1 = c1vector(j);
for k=1:length(c2)
c2 = c2vector(k);
Amatrix(i,j,k) = log(n1) + log(c1) + log(c2);
n1matrix(i,j,k) = n1;
c1matrix(i,j,k) = c1;
c2matrix(i,j,k) =c2;
end
end
end
1 commentaire
Kelvin Anto
le 13 Déc 2021
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Stability Analysis dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




