Plotting time series of Velocity over 48 hours

1 view (last 30 days)
I am trying to plot Velocity over a time frame of 48 hours. I have calculated Vm = 5.07. The given Velocity equation is: V(t) = Vm*sin((2*pi*t)/(Ttide));
My code is:
Vm=5.07; % Calculated on Paper
t=[1:1:48]; % Time over 48 hours
V(t) = Vm*sin((2*pi*t)/(Ttide)); % Velocity Equation
This is outputing a postivie sloping straight line, while I know the line should be sinusoidal.

Accepted Answer

Scott MacKenzie
Scott MacKenzie on 25 Oct 2021
Edited: Scott MacKenzie on 25 Oct 2021
% test value for Ttide (not given in question)
Ttide = 1;
Vm=5.07; % Calculated on Paper
%t=[1:1:48]; % Time over 48 hours
t = linspace(1,48); % use 100 sample points (or more)
V = Vm*sin((2*pi*t)/(Ttide)); % Velocity Equation (NOTE: change V(t) to just V)
John Carroll
John Carroll on 25 Oct 2021
Ive relized this is where my mistake was made!

Sign in to comment.

More Answers (0)


Find more on Acoustics, Noise and Vibration in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by