I have a result calculation and I want to make plot contur in 3 D. From the excel files attxhed I also plot in two dimension of FzWz vs Depth
What is the appropriate Matlab function to create contur in 3 D of FzWz vs Depth
I attach the data file about the data.
Thank you for your kind attention

댓글 수: 2

Akira Agata
Akira Agata 2020년 3월 31일
I believe contour3 can do that task.
But, looking at you data, there are several sheets in Excel file, and each sheet contains ~20 data.
I don't think 20 data points is sufficient to make contour plot. Do you want to concatenate all the data ( = 20 x number of sheet) before making a contour?
Skydriver
Skydriver 2020년 3월 31일
편집: Skydriver 2020년 3월 31일
Yes, but I don't know how to generate this countur, because I only have two values depth and FzWz. In generating 3d I saw I need X, Y and Z. Can you show me how to do that plotting?
I also have the coordinate / geographical position but I am not sure it will help
Thank you

댓글을 달려면 로그인하십시오.

답변 (1개)

Akira Agata
Akira Agata 2020년 3월 31일

0 개 추천

OK. Then, how about the following?
% Read all the data in the Excel file
T = table();
for kk = 1:8
Ttmp = readtable('Contour.xlsx','Range','A:D','Sheet',kk);
T = [T; Ttmp];%#ok
end
% Interpolate the data
% **Note: Since there is duplicated data point, griddata returns Warning**
[xGrid, yGrid] = meshgrid(...
linspace(min(T.Fz),max(T.Fz),20),...
linspace(min(T.wz),max(T.wz),20));
zGrid = griddata(T.Fz,T.wz,T.Depth,xGrid,yGrid);
% Show the result
figure
contour3(xGrid,yGrid,zGrid)
hold on
scatter3(T.Fz,T.wz,T.Depth)
xlabel('Fz','FontSize',14)
ylabel('wz','FontSize',14)
zlabel('Depth','FontSize',14)
colorbar
ax = gca;
ax.View = [-80 40];

댓글 수: 5

Skydriver
Skydriver 2020년 3월 31일
Thank you with your reply but when I looks into the graph it seems little bit different with figure in the excel. I imagine the contour or whatever graphic appearance like a bowl. It doesn't seems straight lines.
Akira Agata
Akira Agata 2020년 3월 31일
Hi Akhmad-san,
I plotted (Fz, wz, Depth) as (x, y, z).
Or, you mean you want to plot "Depth", "Fz*Wz" and "Excel sheet number (50~61)" as x, y, z ??
If so, could you tell us what the z-axis should be (maybe Fz*Wz...?)
Skydriver
Skydriver 2020년 3월 31일
편집: Skydriver 2020년 3월 31일
Dear Akira Agata
Yes I want to plot between Fz*Wz against Depth. I want to know the path distribution of Fz*Wz consider every depth. But I dont know how to fill the gap between x and y. I assume the vertical axis is depth. The function for calculating Fz*Wz is
Fz*Wz = (1-Fs) * (10 - 0.5 *Depth)
where
Fz = (1-Fs)
Wz = (10 - 0.5*Depth)
I have an idea, It coul be coordinat position can be explained as the horisontal distribution. The listing coordinat are show bellow>
50 -7.91234967 -81.66189176
51 -7.89787237 -81.65951006
55 -7.95083978 -81.63047964
56 -7.92746095 -81.62873840
57 -7.86050274 -81.58961408
58 -7.95083978 -81.63047964
59 -7.95083978 -81.63047964
61
Thank you for your supporting idea.
Akira Agata
Akira Agata 2020년 4월 3일
Hi Akhmad-san,
Sorry, it's still not clear for me.
> I want to plot between Fz*Wz against Depth
That must be 2D plot. But the original question is "how to plot contour in 3D".
Also, the listing coordinat you provided in the previous comment is not sufficient to plot contour in 3D.
Could you explain more details on what parameters should be x,y and z, and how the desiered plot looks like.
Skydriver
Skydriver 2020년 4월 4일
My understanding x is FzWz, y is distance between 50 - 51, 51 - 52 etc. and z is Depth.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Environment and Settings에 대해 자세히 알아보기

태그

질문:

2020년 3월 31일

댓글:

2020년 4월 4일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by