Generate (X,Y) grid coordinates from contourf function
Mostrar comentarios más antiguos
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 comentarios
VBBV
el 6 de Dic. de 2020
Use meshgrid function to generate grid for the defined range and use them as contourf arguments
VBBV
el 6 de Dic. de 2020
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
el 6 de Dic. de 2020
Respuestas (1)
Shadaab Siddiqie
el 9 de Dic. de 2020
0 votos
Categorías
Más información sobre Contour Plots en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!