필터 지우기
필터 지우기

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