Hi guys, currently doing a project for my module at uni and we are having to get averages of amplitude from seismic data from certain stations. Each file contains data from one station, with an array called 'seis'. Each column in the array represents a day, however some columns have NaN values (for some reason the seismometer wasn't recording). I can't edit the NaN or else it will throw off amplitude average, so I just want to skip that day (column) in my loop, however I cant seem to figure it out as every time I run the loop I get an error code saying 'Error using 'periodogram', expected x to be finite'
I know I wll probably need to use an 'if' statement, however I dont what to put in so that it skips the NaN columns. Here is the code:
[amp, freq] = periodogram(detrend(seis(:,i)),,,Fs);
NaN is in column 209 if that helps, but I will be using the same code for other files where the NaN is in other columns.
I'm new to Matlab so any help you guys can give would be massively appreciated, thank you in advance!