Extract data from surface (4x1) to 2D matrix
이전 댓글 표시
Hey
I created a 4x1 surface by extracting slices from a 3d grid.
process: x,y,z & D all 160056x1 double xq, yq & zq are mesh
1) 3Dgrid=(x,y,z,Data, xq,yq,zq)
2)xslices=[MinX,MaxX], yslice=MaxY (not needed for my purpose, can I leave it out?), zslice=MaxZ
Slicedata=slice(xq,yq,zq,3Dgrid,xslices, yslice, zslice)
This gives me now a 4x1 surface, I want to get this data, 3 of the 4 slices, in 2d matrices or one 2d matrix so I can visualize the data in a 2d plot. How do I do this, extract data from surface (4x1) in to 2D matrix?
Kind regards,
Jeroen
답변 (2개)
KSSV
2017년 3월 17일
When you use
Slicedata=slice(xq,yq,zq,3Dgrid,xslices, yslice, zslice) ;
Slicedata, thois has all the information. You can extract your coordinates (x,y) from this. Like below:
X = get(Slicedata,'XData') ;
Y = get(Slicedata,'YData') ;
Now you can use
surf(X,Y)
ytu1990
2021년 12월 21일
[X,Y]=meshgrid(min(x):1:max(x),min(y):1:max(y)); 1 is the interval to create the grid
Z=griddata(x,y,z,X,Y);
D=griddata(x,y,Data,X,Y);
subplot(1,2,1);
surf (X,Y,Z);
subplot(1,2,2);
surf (X,Y,Z,D);
카테고리
도움말 센터 및 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!