How to plot this?
조회 수: 3 (최근 30일)
이전 댓글 표시
%Invert the data to use findpeaks to find the valleys
negdepthFeet = -depthFeet;
dur = duration(15,0,0);
% Use findpeaks
[lowerLowWater,lowerLowUTC] = findpeaks(negdepthFeet,
tideTime,'MinPeakProminence',10/12,'MinPeakDistance',dur);
lowerLowWater = -lowerLowWater;
MLLWmud = mean(lowerLowWater);
MLLW = 0;
% Tide level in feet relative to MLLW
feetMLLW = (depthFeet-MLLWmud);
댓글 수: 0
답변 (1개)
Star Strider
2019년 12월 3일
I am not certain what you want to plot, since you did not specify that.
Try this:
tideTime = linspace(0, 4*pi); % Create Data
depthFeet = cos(5*tideTime).*sin(tideTime); % Create Data
negdepthFeet = -depthFeet;
[lowerLowWater,lowerLowUTCidx] = findpeaks(negdepthFeet);
lowerLowWater = -lowerLowWater;
MLLWmud = mean(lowerLowWater);
MLLW = 0;
figure
plot(tideTime, depthFeet)
hold on
plot(tideTime(lowerLowUTCidx), depthFeet(lowerLowUTCidx), 'vr')
hold off
grid
Experiment to get different results.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Polar Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!