Slice a surf plot at certain x and y valus
22 次查看(过去 30 天)
显示 更早的评论
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);
0 个评论
回答(2 个)
Star Strider
2014-5-8
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?’_
另请参阅
类别
在 Help Center 和 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!