submit a constant to matrices

1 次查看(过去 30 天)
Abdulaziz
Abdulaziz 2013-10-2
评论: Matt J 2013-10-2
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
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.

请先登录,再进行评论。

类别

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