using an array in a for loop

1 次查看(过去 30 天)
Steve
Steve 2013-4-10
I want to take an array containing a variable amount of numbers and append each number onto a name that is already defined. I want these names to be stored in a new array to be used later.
for array [0:i]
NewNameArray[i] = DefinedName + array(i);
end

采纳的回答

PT
PT 2013-4-10
array = 1:100;
newarray = cell(length(array),1);
for i = 1:length(array)
newarray(i) = {['Name' num2str(array(i))]};
end

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by