How do I plot a 3D Array in MATLAB?
显示 更早的评论
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
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Stability Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




