Zero Upcrossings, Period and Wave height

2 次查看(过去 30 天)
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 :)

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by