using an array in a for loop

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일

0 개 추천

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

추가 답변 (0개)

카테고리

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

태그

질문:

2013년 4월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by