Zero Upcrossings, Period and Wave height

3 views (last 30 days)
João
João on 17 Oct 2014
Hello guys,
I'm not very good with matlab and despite understanding what i have to do "on paper" I need help with the code. I have a huge amount of points (x=time and y=position) describing a non regular wave. I have this to get the data from the Txt.
filename = '/Users/helenapereira/Desktop/A1-Wave Data.txt';
delimiter = '\t';
startRow = 3;
formatSpec = '%f%f%[^\n\r]';
fileID = fopen(filename,'r');
dataArray = textscan(fileID, formatSpec, 'Delimiter', delimiter, 'HeaderLines' ,startRow-1, 'ReturnOnError', false);
fclose(fileID);
Time = dataArray{:, 1};
WAVE = dataArray{:, 2};
clearvars filename delimiter startRow formatSpec fileID dataArray ans;
How can I get the zero upcrossings? (where it goes from negative to positive). Also I believe that I have to interpolate between two values to find the exact x value of y=0.
From the zero upcrossings how can I get the Periods? And the wave height for each period?
Thanks for the help :)

Answers (0)

Categories

Find more on Get Started with MATLAB 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!