Listing values ​​for a specific harmonic line from waterfall figure

조회 수: 4 (최근 30일)
Jan
Jan 2025년 8월 29일
댓글: Star Strider 2025년 9월 1일
Hello dear Matlab team,
I would like to ask you how to gate listing values ​​for a specific harmonic line from waterfall figure?
I have this waterfall figure below:
It is transpose to imagesc see in following figure:
And I would like to ask you how I can data for specific harmonic line in this figure?
Thank you,
Best regards,
Jan

답변 (1개)

Star Strider
Star Strider 2025년 8월 29일
편집: Star Strider 2025년 8월 29일
By 'harmonic line', I assume you intend frequency, the x-axis coordinate in each plot. A waterfall plot is a specific depiction of a matrix. I use surf here for convenience.
If the one you want matches exactly a frequency in plot, and the frequencies map to the x-axis coordinate exactly (as the columns of the plotted matrix), you can probably just use 'logical indexing' to get them.
However, the easiest way woukld be to use the scatteredInterpolant function. The desired frequency can be anything with in the frequency range. The lines can either be constant with respect to one variable, or vary, as depicted by the 'Diagnoal Line' drawn here. I drew 'DiagonalLine' as a linear relation between 'Frequency' and 'Rotor Speed', however it does not havve to be linear and can be anything that works with the original data.
Example --
rsv = (0:0.5:8).';
frqv = (0:0.5:10).';
[Fm,RSm] = ndgrid(frqv, rsv);
Data = exp(-((Fm-2).^2/4.5+(RSm-6).^2)/3.5);
% disp(Data)
FRS = scatteredInterpolant(Fm(:), RSm(:), Data(:))
FRS =
scatteredInterpolant with properties: Points: [357×2 double] Values: [357×1 double] Method: 'linear' ExtrapolationMethod: 'linear'
RotorSpeed_Frequency_2pi = FRS(frqv, ones(size(frqv))*2*pi)
RotorSpeed_Frequency_2pi = 21×1
0.7454 0.8330 0.9018 0.9458 0.9610 0.9458 0.9018 0.8330 0.7454 0.6462 0.5427 0.4415 0.3479 0.2657 0.1965
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
RotorSpeed_Frequency_pi = FRS(frqv, ones(size(frqv))*pi)
RotorSpeed_Frequency_pi = 21×1
0.0793 0.0887 0.0960 0.1007 0.1023 0.1007 0.0960 0.0887 0.0793 0.0688 0.0578 0.0470 0.0370 0.0283 0.0209
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
RSvF = frqv*1.1 + 0.5;
DiagonalLine = FRS(frqv, RSvF)
DiagonalLine = 21×1
0.0001 0.0009 0.0042 0.0160 0.0487 0.1201 0.2425 0.4020 0.5479 0.6140 0.5647 0.4195 0.2558 0.1282 0.0479
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
figure
surf(Fm, RSm,Data, FaceAlpha=0.4, EdgeAlpha=0.5, DisplayName='Frequency-Rotor Speed Surface')
xlabel('Frequency')
ylabel('Rotor Speed')
colormap(turbo)
hold on
plot3(frqv, ones(size(frqv))*pi, RotorSpeed_Frequency_pi, '-b', LineWidth=2, DisplayName='Frequency=\pi')
plot3(frqv, ones(size(frqv))*2*pi, RotorSpeed_Frequency_2pi, '-r', LineWidth=2, DisplayName='Frequency=2\pi')
plot3(frqv, RSvF, DiagonalLine, '-m', LineWidth=2, DisplayName='Diagonal Line')
hold off
legend(Location='best')
axis([0 10 0 8])
view(50,45)
.
EDIT -- (29 Aug 2025 at 17:01)
Added 'Diagonal Line', added to discussion, tweaked code.
.
  댓글 수: 4
Jan
Jan 2025년 9월 1일
ok, thank you very much for this support. I tested the ExtrapolationMethod based on link: scatteredInterpolant - Interpolate 2-D or 3-D scattered data - MATLAB
on other hand, harmonic line data are practically good based on this script.
I try to apply for my big data analysis. Thank you very much 😊
Star Strider
Star Strider 2025년 9월 1일
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.

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

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품


릴리스

R2025a

Community Treasure Hunt

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

Start Hunting!

Translated by