'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 CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by