Slice a surf plot at certain x and y valus
이전 댓글 표시
I have as set of f(x,y) data which I inperpoled useing scatteredInterpolant. Then I've displayed the data useing meshgrid and surf.
Now I would like to cut trough that surface at certain x any y values. I do not have volumetric data so I can not use slice or contourslice.
I would like do recive a contour of the surface at a given x or y value.
Does anyone have an idea?
Thank you
F = scatteredInterpolant(x,y,z);
dimx=(max(x)-min(x))/30;
dimy=(max(y)-min(y))/30;
xw = min(x):dimx:max(x);
yw = min(y):dimy:max(y);
[xq,yq] = meshgrid(xw,yw);
zq = F(xq,yq);
surf(xq,yq,zq);
답변 (2개)
Star Strider
2014년 5월 8일
1 개 추천
If you only want to view the plot between certain x and y values, the axis function might do what you want. You can set the x and y axis limits to whatever interval you want. They will be the same whether you use surf, surfc, contour, or any of the others.
If you want to extract the data from x and z for a particular value of y, or y and z for a particular value of x, that is simply the way you would extract row or column data from any matrix.
댓글 수: 1
Star Strider
2014년 5월 22일
‘thank you for your answer.
The axis function is not what i look for because i want to desplay the cuts in 2d and extracting rows or columns does not work eather beacouse ther are just a certain number of columns and the rest is interpolated. i want to be able to cut at any x and y value.
any suggestions?’_
카테고리
도움말 센터 및 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!