What is the Fastest way to write the following algorithm

1 回表示 (過去 30 日間)
Jab
Jab 2016 年 8 月 7 日
コメント済み: Walter Roberson 2016 年 8 月 8 日
I have a cell array y={1X5} each cell contains 256*256*10(3rd dimension will vary for each cell) 3D vectors. My need is to convert the cell array to matrix of the form 256*256*100. Could anyone please help me to write the fastest simple code. Thanks
  2 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2016 年 8 月 7 日
You mean the result is 256x256x50
Jab
Jab 2016 年 8 月 7 日
if all the 3rd dimension has the 10 exactly the result will be 256*256*50 otherwise it varies

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

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 8 月 7 日
編集済み: Azzi Abdelmalek 2016 年 8 月 7 日
A=cell(1,5)
A=cellfun(@(x) randi(10,256,256,10),A,'un',0) % ---Example----
B=cat(3,A{:});
  2 件のコメント
Jab
Jab 2016 年 8 月 7 日
Could you please explain this code? Thank you so much
Walter Roberson
Walter Roberson 2016 年 8 月 8 日
The first two lines of it create random data of the proper size, for the sake of illustrating the third line which is the line you need to use on your own cell array.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by