Sequence of adding numbers
1 次查看(过去 30 天)
显示 更早的评论
Hi i have like this question. Lets say i have this code : for i=1:4 C=2+i; end
this gives me this answer: C=3, C=4,C=5,C=6
BUT I want like this answer: C1=3, C2=4, C3=5, C4=6, which is with numbers after letter C. Can anyone help please...thanks :)
1 个评论
Geoff Hayes
2014-6-11
编辑:Geoff Hayes
2014-6-11
This isn't all that different from your previous question http://www.mathworks.com/matlabcentral/answers/131244-string-value-and-sequently-representation….
采纳的回答
Azzi Abdelmalek
2014-6-11
编辑:Azzi Abdelmalek
2014-6-11
The best way is
for k=1:4
C(k)=2+k
end
Look at this link
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!