フィルターのクリア

how to set new variable for each cycle?

2 ビュー (過去 30 日間)
Megha
Megha 2018 年 8 月 13 日
コメント済み: Megha 2018 年 8 月 16 日
The figure shows the data of the form sine wave. Now, I wish to define one new variable (e.g. a1, a2, a3) each corresponding to one cycle? Is it possible?
  2 件のコメント
Megha
Megha 2018 年 8 月 13 日
Stephen23
Stephen23 2018 年 8 月 13 日
"Now, I wish to define one new variable (e.g. a1, a2, a3) each corresponding to one cycle?"
The MATLAB documentation specifically advises against doing this: "A frequent use of the eval function is to create sets of variables such as A1, A2, ..., An, but this approach does not use the array processing power of MATLAB and is not recommended. The preferred method is to store related data in a single array"
"Is it possible?"
Sure, it is possible, but only if you want to force yourself into writing slow, complex, buggy code. Read this to know more:
It is much simpler and more efficient to use indexing. You should use indexing.

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

採用された回答

KSSV
KSSV 2018 年 8 月 13 日
Get the indices of the least values...and you can divide/ name your data. Read about min, findpeaks and logical indexing.
  2 件のコメント
Walter Roberson
Walter Roberson 2018 年 8 月 13 日
Megha
Megha 2018 年 8 月 16 日
@KSSV and @Walter, sorry, I could not exactly understand your suggestions. However, I found some other way to solve this problem.
Thanks for the help

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by