How to extract data from fnplt plot?

조회 수: 3 (최근 30일)
Lu Da Silva
Lu Da Silva 2021년 4월 10일
답변: Abhaya 2025년 1월 20일
I created two plots using the fnplt function. One plot represents the chord length (c) over the radial position, the other the thickness (t) over the radial position (-> they both have the same x-axis).
The chord and thickness values are calculated via ppmak function (with breaks and coefficients):
chord = ppmak(breaks_chord,coefs_chord,1);
for i = 1:length(breaks_chord)-1
fnplt(chord,[breaks_chord(i) breaks_chord(i+1)],'k')
hold on
end
I need to calculate the height h = c*t and plot h against the radial position.
How can I extract the c and t values at specific x-axis values (e.g. x=10, x=20, x=30)?
The functions 'findobj' and 'get' do not work.
Thanks in advance!

답변 (1개)

Abhaya
Abhaya 2025년 1월 20일
Hi,
To evaluate the values of 'chord' and 'thickness' at specific 'x' position, you can use MATLAB 'fnval' function.
Please refer to the steps given below to achieve this.
  • Use MATLAB 'fnval' function to evaluate the chord and thickness at your desired 'x' value:
c = fnval(chord,x);
t = fnval(thickness,x);
  • Calculate the height 'h' as the product of 'c' and 't':
h = c * t; % Calculate the height as the product of chord and thickness
For more details on using the fnval function, refer to the official MATLAB documentation:

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by