필터 지우기
필터 지우기

1D Spline from 2D Skalar Field

조회 수: 2 (최근 30일)
Florian Flaig
Florian Flaig 2022년 4월 11일
댓글: Florian Flaig 2022년 4월 12일
Hello community,
I have a problem.
I have a 2D skalar-field and need support points to describe the red curve.
The red curve is any curve that projects a straight line onto the z=0 plane.
Below you can see a Plot of the 2D skalar-Flied, which I have as a matrix.
In addition, I have the mathematical description of the dark red line.
What are the z values of the light red line? (which I have inserted with Paint)
Thankyou for your Help.
Greetings, Florian

채택된 답변

Florian Flaig
Florian Flaig 2022년 4월 12일
copy of marc li:
OK, if your surface data are X, Y and Z and your dark red line data are x and y, you can get data of the red line about z axis:
z = interp2(X,Y,Z,x,y);
and plot the red line:
hold on;
plot3(x,y,z)

추가 답변 (1개)

mark li
mark li 2022년 4월 11일
You may get information of the curve by handles.
Firstly, you get the handle of the figure by gcf, the figure have three children which are a surface and two lines. The code is shown as
Child = get(gcf, 'Children');
The Child may be 3x1 handles, and you can :
get(child(1)), get(child(2)), get(child(3))
According to result, you select proper index.
  댓글 수: 3
mark li
mark li 2022년 4월 12일
OK, if your surface data are X, Y and Z and your dark red line data are x and y, you can get data of the red line about z axis:
z = interp2(X,Y,Z,x,y);
and plot the red line:
hold on;
plot3(x,y,z)
Florian Flaig
Florian Flaig 2022년 4월 12일
Thank you very mouch marc. Now it works. :-)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Smoothing에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by