hi all!
I am trying to seperate chunks of a timeseries into sleep vs. wake components.
I'm having problems with two things:
1) I've figured out how to do it with one section, but I want to be able to do it with multiple sections, e.g. 200-600 seconds and 750-800 seconds.
2) I also want to take these chunks of the timeseries and then calculate the power. When I try to run my script to calculate the power, I get a ton of errors I think because sleep_c (etc) is = 1×1 double times, rather than my normal ts = 1000×1 double
thanks times a million:
I've done this:
%%%%loading
sleep_behavior = 1500:3000sleep_c = timeseries(d_c_ts_1(sleep_behavior,1), 1500:3000,'name', 'fMRI signal')sleep_behavior = 1500:3000sleep_v = timeseries(d_v_ts_1(sleep_behavior,1), 1500:3000,'name', 'fMRI signal')wake_behavior = 100:200wake_c = timeseries(d_c_ts_1(wake_behavior,1), 100:200,'name', 'fMRI signal')wake_behavior = 100:200wake_v = timeseries(d_v_ts_1(wake_behavior,1), 100:200,'name', 'fMRI signal')%% calculating power of sleep vs. wake ----- power vs. frequency
for a = 1:1 name = sleep_v [power_sleep_v, f] = mtspectrumc(name,params) %detrended cortex young person
end
Best Answer