how to number every val in a cell array?

1 回表示 (過去 30 日間)
Ilias Minas
Ilias Minas 2019 年 9 月 22 日
コメント済み: Walter Roberson 2019 年 9 月 22 日
Hi all,
I have a 7-D cell array doing with 7 variables having from 1 -15 values each.
The result i am taking has the following form.
A 7-D array with val(:,:,1:15,1:5,1:7,1:8,1:9) . All the possible combinations of 7 variables are 37800.
S i want to create an array or number them in order to identify which combination corresponds to which result.
For example val(:,:,1,1,1,1,1) is case 1.
Thank you very much
  2 件のコメント
Rik
Rik 2019 年 9 月 22 日
The sub2ind function is probably useful for you, but I don't understand your question well enough to tell you how.
Walter Roberson
Walter Roberson 2019 年 9 月 22 日
For index val(:,:,A,B,C,D,E,F,G) then
valsize = size(val);
valsize = valsize(end-6:end);
index = sub2ind(valsize, A, B, C, D, E, F, G);

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

回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by