フィルターのクリア

How to create a vector?

2 ビュー (過去 30 日間)
Ioana Mateescuu
Ioana Mateescuu 2019 年 1 月 21 日
コメント済み: Stephen23 2019 年 1 月 22 日
How can I create a vector containing all the k values? Thank you!
beat_count=0;
for k=2:length(val)-1;
if(val(k)>val(k-1)&val(k)>val(k+1)&val(k)>1)
k
disp('Prominant peak found');
beat_count=beat_count+1;
end
end

採用された回答

Kevin Phung
Kevin Phung 2019 年 1 月 21 日
v = [];
for k=2:length(val)-1;
if(val(k)>val(k-1)&val(k)>val(k+1)&val(k)>1)
k
disp('Prominant peak found');
beat_count=beat_count+1;
v(end+1) = k % save k value into vector v;
end
end
  2 件のコメント
Ioana Mateescuu
Ioana Mateescuu 2019 年 1 月 21 日
Thank you!
Stephen23
Stephen23 2019 年 1 月 22 日

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCurve Fitting Toolbox についてさらに検索

製品


リリース

R2007b

Community Treasure Hunt

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

Start Hunting!

Translated by