Error:Unable to read MAT-file .../slprj/​_jitprj/ji​tEngineAcc​essInfo.ma​t. Not a binary MAT-file. Try load -ASCII to read as text.

Enabled source control to GitHub, with LFS. Everything worked from command line. A couple compiles, later, this error stops Simulink.
Error:Unable to read MAT-file .../slprj/_jitprj/jitEngineAccessInfo.mat. Not a binary MAT-file. Try load -ASCII to read as text.
I navigate to this file. It is an ascii file. The contents are:
version https://git-lfs.github.com/spec/v1
oid sha256:3c0869504c7ced452f0c917bcefc09e3ef161894a7530f6e597e99c82a71a91c
size 2434
LFS does seem to have added something to this file, and there is an object ID hash, and a size.
How do I get Simulink compiling again? LFS is needed to track the workspace variables .mat file, as it's 134 MB.

댓글 수: 4

>> load('/home/matt/OPV_abraxas3d/slprj/_jitprj/jitEngineAccessInfo.mat', "-ASCII")
Error using load
Unknown text on line number 1 of ASCII file
/home/matt/OPV_abraxas3d/slprj/_jitprj/jitEngineAccessInfo.mat
"version".
I started over, uninstalled LFS from the system, reinitialized git, added all the files, removed the saved workplace file, committed, set the remote location, and attempted to use source control from within MATLAB. That worked. And, the file compiles a-ok.
Is LFS incompatible with the native source control in MATLAB?
-abx
This has happened again, twice. No LFS involved, but somehow Simulink populated jitEngineAccessInfo with stale LFS data in the first line, which renders Simulink unable to read this file, and everything halts.
I deleted the file and could run the model.
Can you provide the files or more information? There is nothing here for the Community to review to reproduce your problem. If using GIT, you may need to configure your GIT settings to treat MAT files as binary rather than text.
Also you may want to put the slprj folder into the .gitignore list since those are all temporary files and you would not want to be pushing them to a GIT repository.

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

답변 (1개)

Check the settings for .mat files. It must be Committed (Pushed) as binary (by default git treats all files as text, and can change the format of the end of the line (CR LF, LF), thereby changing the mat file as well and then it is unreadable).
Example of setting .gitattributes for Matlab files:
* text=auto
# Matlab
*.mat binary
*.fig binary
*.mdl binary diff merge=mlAutoMerge
*.mdlp binary
*.mex* binary
*.mlapp binary
*.mldatx binary
*.mlproj binary
*.mlx binary
Example of setting .gitattributes for LFS (mat file as binary):
# LFS
*.mat filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text

카테고리

도움말 센터File Exchange에서 Git in MATLAB에 대해 자세히 알아보기

제품

릴리스

R2023a

질문:

2024년 3월 10일

답변:

2024년 8월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by