submit a constant to matrices

Hi guys I am wondering how can I define first element of number of matrices as a constant
I tried T{1:10}(1)=7; but I got the following message
??? Scalar cell array indices required in this assignment.
I appreciate your help

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 10월 2일
편집: Azzi Abdelmalek 2013년 10월 2일

0 개 추천

for k=1:numel(T)
T{k}(1)=7
end

댓글 수: 2

Abdulaziz
Abdulaziz 2013년 10월 2일
Thanks Azzi this works but I just want to avoid using for loop as i can.
I appreciate
Matt J
Matt J 2013년 10월 2일
You cannot avoid a for-loop. Nor is there a good reason to.

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

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

질문:

2013년 10월 2일

댓글:

2013년 10월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by