storing values from a for loop into a new variable

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일

0 개 추천

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개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

질문:

2018년 12월 12일

답변:

2018년 12월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by