How to plot this?

3 次查看(过去 30 天)
Alecia Gill
Alecia Gill 2019-12-3
%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);

回答(1 个)

Star Strider
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.

类别

Help CenterFile Exchange 中查找有关 Polar Plots 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by