'Index exceeds matrix dimensions'

5 ビュー (過去 30 日間)
Ismail T. Ahmed
Ismail T. Ahmed 2017 年 6 月 24 日
コメント済み: Ismail T. Ahmed 2017 年 6 月 24 日
I have the following code:
load ./x.mat %%load the total images cell is 48000
B=zeros([32 32 1 48000]); % as 4-D double
v=length(x);
for i = 1 :v
y=cell2mat(x(i));
B(:,:,:,i)=y(i);
end
The error is Index exceeds matrix dimensions.
Error in fourDim_creation (line 19)
B(:,:,:,i)=y(i);
How can solve that? Thanks
  1 件のコメント
KSSV
KSSV 2017 年 6 月 24 日
what is x ??? If it is a cell of 4800, what each cell has? It is better to attach .mat file, so that we can check and help you.

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

採用された回答

Walter Roberson
Walter Roberson 2017 年 6 月 24 日
B(:,:,:,i) = y; %not y(i)
  1 件のコメント
Ismail T. Ahmed
Ismail T. Ahmed 2017 年 6 月 24 日
Thanks a lot Walter Roberson for your answer

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

その他の回答 (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