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!