필터 지우기
필터 지우기

storing values from a for loop into a new variable

조회 수: 1 (최근 30일)
Native
Native 2018년 12월 12일
답변: Stephen23 2018년 12월 12일
for i = 1:length(row)
sol{i}
disp i
end
How can I store the values obtained (characters, not numbers) in a new variable?

채택된 답변

Stephen23
Stephen23 2018년 12월 12일
N = numel(row);
C = cell(1,N);
for k = 1:N
C{k} = sol{k}
end
Or without a loop:
C = sol(1:N)

추가 답변 (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