How to fill an array with the elements of a for loop?

12 次查看(过去 30 天)
Hi, i have this code, and i want to put all of the elements from the loop inside an array, can anyone help me?
ll=[1 2 3 4 5]
for c= 1:1:length(ll)
element=ll(c)+3
end
%%result==>> ll= 4 5 6 7 8

采纳的回答

Soniya Jain
Soniya Jain 2021-7-8
编辑:Soniya Jain 2021-7-8
Use element(c) instead

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by