I need to save "St" that generated with in a loop, as St1, St2, St3... "St" looks like below. Also I need to load those St1, St2, St3.. in a program.
St =
R: [5x5 double]
df: 7
normr: 0.0799

댓글 수: 1

Stephen23
Stephen23 2018년 7월 25일
"I need to save "St" that generated with in a loop, as St1, St2, St3..."
That is exactly what you should not do. Read this to know why:

댓글을 달려면 로그인하십시오.

답변 (2개)

KSSV
KSSV 2018년 7월 25일

0 개 추천

T = struct ;
for i = 1:3
T(i).st = rand(3,1) ;
end
Stephen23
Stephen23 2018년 7월 25일

0 개 추천

Just use indexing:
for k = ...
S(k) = st
end
and you will get all of your data in one non-scalar structure.

카테고리

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

질문:

2018년 7월 25일

댓글:

2018년 7월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by