필터 지우기
필터 지우기

Save structure in matlanb

조회 수: 4 (최근 30일)
Rica
Rica 2018년 3월 23일
편집: Rica 2018년 3월 23일
Hi all, i do some measurement sequentially.
Meas(1).delay
Meas(1).Velocity
Meas(2).delay
Meas(2).Velocity
and so on. the number of measurement is large
to save the structure after doing the measurement i use:
save('Data','Meas','-append')
but it seems that it does not work properly. Could you help? Thank you

채택된 답변

Stephen23
Stephen23 2018년 3월 23일
편집: Stephen23 2018년 3월 23일
"but it seems that it does not work properly"
It does exactly what the save documentation states for that option: "If a variable already exists in a MAT-file, then save overwrites it with the value in the workspace." The problem is not that the option does not work, the problem is that the option is very badly named and some users do not read the documentation. It should be called "replace", or "overwrite", or something similar.
To append new data to the end of a variable in a .mat file you will have to load the variable, append the new data, and then save the variable again. Or use matfile.
  댓글 수: 1
Rica
Rica 2018년 3월 23일
편집: Rica 2018년 3월 23일
Than you. I solve it with matfile:
m = matfile(filename,'Writable',true);
m.Meas = [m.Meas,Meas];

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

추가 답변 (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