load variables in workspace except the ones with '.' in them

조회 수: 4 (최근 30일)
Sankar Mahadevan
Sankar Mahadevan 2022년 3월 16일
댓글: Image Analyst 2022년 3월 16일
I am running into an issue with my .mat file where one of the variable names has a . in it. How do I ignore the variable from my load command? the name of the varibale is sample.proportion. The load command that works is:
A=load('sample.mat', '-regexp','^(?!sample.proportion)...')
Now how do I edit this load command to allow it to ignore any variable with a . in it?eg test.proprotion, data.test, test,example etc
  댓글 수: 7
Sankar Mahadevan
Sankar Mahadevan 2022년 3월 16일
It was produced from another program, using a matlab script. The strange thing is if I double click the file the variables minus the .proportion variable name loads up. But If i use A=load('sample.dat') it fails to parse the variable name
Image Analyst
Image Analyst 2022년 3월 16일
How about we just quit guessing and you attach the actual MAT file so people can try things?

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

답변 (1개)

Stephen23
Stephen23 2022년 3월 16일
편집: Stephen23 2022년 3월 16일
With a sufficiently old MATLAB release you can use this:
See also:
or try Octave, which according to some forums I have read is slightly more forgiving when loading MAT-files.

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by