필터 지우기
필터 지우기

Generate (X,Y) grid coordinates from contourf function

조회 수: 3 (최근 30일)
Michael Elman
Michael Elman 2020년 12월 6일
답변: Shadaab Siddiqie 2020년 12월 9일
Hello everyone,
I need to generate a grid from contourf function (I need the coordinates of the grid lines and the center of each cell, later I will perform the integral on this grid).
Does anyone know how can I obtain these values? Any help is appreciated.
X_s = readmatrix('Xs.xlsx');
Y_s = readmatrix('Ys.xlsx');
Z_s = readmatrix('Zs.xlsx');
R_s=sqrt(X_s.^2+Y_s.^2+Z_s.^2);
Phi_s=atan2(Y_s,X_s);
figure()
contourf(X_s,Y_s,R_s,20,'r','Linewidth',2)
axis equal
xlabel('X_s')
ylabel('Y_s')
colorbar
hold on
contour(X_s,Y_s,rad2deg(Phi_s),20,'k','Linewidth',1)
  댓글 수: 3
VBBV
VBBV 2020년 12월 6일
In your program the X, Y grid is taken from excel files. Look at the range of values in those files and define them using meshgrid
Michael Elman
Michael Elman 2020년 12월 6일
How can i define a range from my matrices and keeping a shape of the object in the same time? In this problem the spacing is not uniform.

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

답변 (1개)

Shadaab Siddiqie
Shadaab Siddiqie 2020년 12월 9일
From my understanding you want to generate a grid from contourf function, you can refere meshgrid and contourf.

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by