等高線上の値(行列の​Index)を取得す​る方法はありますか?

contourにて行列の等高線を描けますが、等高線上の値(行列のIndex)を取得する方法はありますか?
値が変わる境界を抽出したいです。

 Accepted Answer

mizu
mizu on 21 Nov 2018

2 votes

出力引数を指定すれば取得できます.
x = linspace(-2*pi,2*pi);
y = linspace(0,4*pi);
[X,Y] = meshgrid(x,y);
Z = sin(X)+cos(Y);
figure
[C,h] = contour(X,Y,Z)
C が等高線行列です.X値やY値のことであれば,h.XData や h.YData で取得できます.

1 Comment

KenShi
KenShi on 21 Nov 2018
ありがとうございます!!!
やりたかった事ができました。
とても助かりました。

Sign in to comment.

More Answers (0)

Products

Asked:

on 21 Nov 2018

Commented:

on 21 Nov 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!