Computing 3d plot with three AxBxC arrays
6 次查看(过去 30 天)
显示 更早的评论
Hi All,
I am working on a project and I have computed data like given in the code below. If the data is 2 by 2, I can get a 3d graph, but my data are 3 dimensional. I want to get a graph in which the first axis is 'Qx' the second 'Qy' and the third one should be 'ed' or 'Ax'. Please check out the code, you will understand what I meant. Any help will be appreciated. Thanks in advance.
Best regards,
OA
% cift for loop ile meshgrid komutu yazildi. Cooooookkk Onemlliiiii
% As=Lx/Ly % Aspect ratio of the building
% Lx=35
% Ly=[1:3:100];
% As=Lx./Ly
j=1;
k=1;
l=1;
Lx=1;
Ly=1;
Ax=1;
As=1;
e=0;
for Ax=0.7:0.1:3;
for Qx=0:0.1:2.5;
for Qy=0:0.1:2.5;
edx(k,j,l)=(((Qy*(sqrt(((As^-2+1)*(Lx)^2)/12)+e))^2)/Lx)*((1.2*(Ax^0.5)-1)/(0.6*(Ax^0.5)));
edy(k,j,l)=(((Qx*(sqrt(((As^2+1)*(Ly)^2)/12)+e))^2)/Ly)*((1.2*(Ax^0.5)-1)/(0.6*(Ax^0.5)));
ed(k,j,l)=sqrt(edx(k,j).^2+edy(k,j).^2);
Axx(k,j,l)=Ax;
QQx(k,j,l)=Qx;
QQy(k,j,l)=Qy;
Axx(k,j,l)=Ax;
k=k+1;
end
k=1;
j=j+1;
end
j=1;
l=l+1;
end
figure (3)
surf(QQx,QQy,Axx);
xlabel('Qx');
ylabel('Qy');
zlabel('Accidental eccentricity (m)'); % burasinin Accidental eccentricity olmasinin sebebi e=0 olarak almamizdan kaynaklanmaktadir.
% shading interp
colorbar
figure (4)
contour(QQx,QQy,Axx,30);
xlabel('Qx');
ylabel('Qy');
zlabel('Accidental eccentricity (m)'); % burasinin Accidental eccentricity olmasinin sebebi e=0 olarak almamizdan kaynaklanmaktadir.
% shading interp
colorbar
4 个评论
Star Strider
2023-8-22
My pleasure!
I did not post it as an Answer because I was not certain it was what you wanted, especially with respect to the contour plots (that cannot exist for constant matrices).
采纳的回答
Steven Lord
2023-8-22
Based on what Star Strider posted and looking at the Types of MATLAB Plots page in the documentation (which is also available in a slightly different form in the Plots tab in the Toolstrip) it seems like slice or contourslice or perhaps contour3 will be of use to you. [The isosurface function should probably be in this list as well, in the Volume Visualization or Contour Plots sections. I'll note that to the documentation staff.]
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!