I receive an error about closing a MAT file. Why?

조회 수: 3 (최근 30일)
Sara Salimi
Sara Salimi 2017년 1월 1일
답변: M Shujah Islam Sameem 2019년 12월 19일
Hi
I am using Matlab 2016b. I am using the following command:
L=matfile(sprintf(lb_formatSpec,ix),'writable',true);
L.image=lb_Vol(:,:,ix);
To save in a mat file but I am getting the following error:
Error closing file
C:\Users\user\Desktop\Data_Preparation\labels-006-068.mat.
In this link, it is said data can be saved in version -v7.3. My question is how can I save my mat files with this version by using matfile() function ??
Your help is appreciated.

답변 (2개)

Star Strider
Star Strider 2017년 1월 1일
Unless there is a specific reason you are using the matfile function, the best option is to use the save function, at least to initially create the ‘.mat’ file. That allows you to specify the version. You can then use matfile for subsequent access to it.
  댓글 수: 2
Sara Salimi
Sara Salimi 2017년 1월 1일
@Star Strider Thanks for your response,
Is there any other way to solve this error if I use matfile() function?
I cannot save as ".mat" file since I need to use some fields of "matfile()"
Star Strider
Star Strider 2017년 1월 1일
My pleasure.
‘Is there any other way to solve this error if I use matfile() function?’
Not that I can find in the documentation.
The matfile function may not be your best option. See the documentation for load to see if it will do what you want.

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


M Shujah Islam Sameem
M Shujah Islam Sameem 2019년 12월 19일
Sometimes overwriting issue

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by