필터 지우기
필터 지우기

problem to save structura in .mat file

조회 수: 3 (최근 30일)
Luca Re
Luca Re 2023년 6월 9일
댓글: Stephen23 2023년 6월 9일
a.w=1;
a.r="ff";
a.v=3;
a.s="a.tst";
save(a.s,'-struct','a')
a=load("a.tst","-mat");
i see 1X1 struct and not as original
  댓글 수: 3
Luca Re
Luca Re 2023년 6월 9일
편집: Luca Re 2023년 6월 9일
I had an analog example and was unable to change the fields
Now problem is solved .thanks
Stephen23
Stephen23 2023년 6월 9일
"i see 1X1 struct and not as original"
The original is also a 1x1 struct. They look exactly the same to me:
a.w = 1;
a.r = "ff";
a.v = 3;
a.s = "a.tst"
a = struct with fields:
w: 1 r: "ff" v: 3 s: "a.tst"
save(a.s,'-struct','a')
clearvars
b = load("a.tst","-mat")
b = struct with fields:
w: 1 r: "ff" v: 3 s: "a.tst"

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT-Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by