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!




