필터 지우기
필터 지우기

salve one field in the same struct is possible?

조회 수: 1 (최근 30일)
piero
piero 2023년 6월 24일
댓글: piero 2023년 6월 24일
example:
A.b=3;
A.c=4;
A.d=6;
save("vv",'-struct','A');
A.d=7;
save("vv",'-struct','A','d'); %%don run correctly
%i dont' want resave A.b A.c ..i want only resave A.d
  댓글 수: 4
the cyclist
the cyclist 2023년 6월 24일
For the sake of other folks -- like me! -- who didn't realize this, the syntax
save("vv","-struct","A")
saves all the fields of the structure A as individual variables.
So, the question is whether one can just "append" d to the file, even though A.b and A.c may have changed.
piero
piero 2023년 6월 24일
here is correct..
but i don't want to add a field 'd' ..i want ro modified on file field 'd' (modifies on file)

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

채택된 답변

the cyclist
the cyclist 2023년 6월 24일
I believe that
save('vv','-struct','A','d','-append')
will do what you want

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Whos에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by