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 Center および File ExchangeStructures についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by