필터 지우기
필터 지우기

Inserting a double into the elements of a cell

조회 수: 1 (최근 30일)
Cagas Akalin
Cagas Akalin 2017년 1월 15일
댓글: Cagas Akalin 2017년 1월 15일
Hi everyone,
I would like to ask for your opinions assocaiated with creating a cell in which each box includes 1x2 array such that is [1 2]. For this purpose, I tried a four-loop which is as follows.
for i = 1:11
for j = 1:11
for k = 1:11
for l = 1:11
b{i,j}(k,l)=[1 2];
end
end
end
end
As you guess, it gives the warning "Subscripted assignment dimension mismatch.". On the other hand, replacing [1 2] with 3 nearly yields to what I would like to create without any error.
for i = 1:11
for j = 1:11
for k = 1:11
for l = 1:11
b{i,j}(k,l)=3;
end
end
end
end
Is there any possibility to solve this problem?
  댓글 수: 1
Cagas Akalin
Cagas Akalin 2017년 1월 15일
I will be a answer to my own question. Replacing (k,l) with {k,l} gives me what I want to obtain.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by