How to perform data analysis on each column of matrix individually and plot each column individually?

1 回表示 (過去 30 日間)
I have a matrix of 20000 X 176 I want to perform data analysis of each column individually and plot each column individually. Is there a fast way to do this.
This is my data analysis (with lead53 = column 53)
if true
lead53 = data.signals(:,53);
dlead53 = gradient(lead53(:,1))/(1/fs)
ch1 = zeros (length(lead53(:,1)),1);
for n = 1: length(lead53);
if dlead53(n) > 500 %select pacing spikes
ch1(n-3) = lead53(n-3);
ch1(n-2) = lead53(n-2);
ch1(n-1) = lead53(n-1);
ch1(n) = lead53(n);
ch1(n+1) = lead53(n+1);
ch1(n+2) = lead53(n+2);
ch1(n+3) = lead53(n+3);
end
if dlead53(n) < 500
ch1 (n) = 0;
end
end
ch1(ch1==0) = NaN
plot (t, lead53, 'b')
hold on
plot (t, ch1, '-g') %pacing spikes in green
hold off
end

回答 (1 件)

José-Luis
José-Luis 2016 年 12 月 14 日
編集済み: José-Luis 2016 年 12 月 14 日
data = rand(100,5);
%Loop through the columns
for ii = data
%do your thing: ii is a column vector containing the data of a column
end
Depending on what you actually want to do, it might be possible to vectorize.
  2 件のコメント
Nariç Durmus
Nariç Durmus 2016 年 12 月 14 日
This does not separate the figures of the columns
José-Luis
José-Luis 2016 年 12 月 14 日
編集済み: José-Luis 2016 年 12 月 14 日
I don't understand what you mean. Do subplots? Create a new figure for each loop iteration?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangePolynomials についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by