フィルターのクリア

returning values of a matrix between two values

8 ビュー (過去 30 日間)
PAK
PAK 2018 年 8 月 23 日
コメント済み: PAK 2018 年 8 月 30 日
Hi Matlab Experts,
I've got a basic question.
If I've created a matrix:
data_bounds = [event_samples(1),event_samples(end)]; % let's say its value is [79502,5316744]
In my case, this data_bounds variable corresponds to column numbers in another matrix (say it is called "data"). How do I pull the columns from data between the values of data_bounds?
Thanks!
PK

回答 (2 件)

Aquatris
Aquatris 2018 年 8 月 23 日
desiredData = data(:,event_samples(1):event_samples(end))

PAK
PAK 2018 年 8 月 23 日
Hi,
I tried that, but I get the error
"Index in position 2 exceeds array bounds (must not exceed 5272240)".
Do you have any ideas why this may be?
Thanks!
PK
  2 件のコメント
Aquatris
Aquatris 2018 年 8 月 23 日
That means the "data" variable does not have 5272240 elements in it, which means you are calculating the bounds wrong.
Or you actually store data as row, in which case you should use
desiredData = data(event_samples(1):event_samples(end),:)
What is the size of your data variable?
PAK
PAK 2018 年 8 月 30 日
Hi, This worked! Thank you!!

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

カテゴリ

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

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by