Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
how to form rectangular matrix of x, y, z in (:,:,3) format from circular data
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have data of D(:,:,3) format where x= 5*sin(theta)cos(phi), y=5*sin(theta)sin(phi) and z some data related to this points where theta= 0-pi/2 and phi = 0-2 pi. how can i rearrange the data of z in to [X,Y]=ndgrid(x,y) for x=linspace(-t,t,n) , y=linspace(-t,t,n) format?
5 Kommentare
Titus Edelhofer
am 21 Apr. 2015
Hi,
please take a look at the answer below: if you have e.g. x=-5:0.5:5, y=-5:0.5:5, then create matrices X, Y with
[X,Y] = meshgrid(x,y);
Use these matrices as points xi, yi when calling griddata.
Titus
Antworten (1)
Titus Edelhofer
am 21 Apr. 2015
Hi,
if I understand correctly you have a set of points which are given on 3D spheres and want to have them on a regular (cartesian) grid. If this is the case, then you are looking for the function
griddata
You construct the grid using meshgrid or ndgrid and use griddata to interpolate your points onto this grid.
Titus
1 Kommentar
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!