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

1 次查看(过去 30 天)
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

请先登录,再进行评论。

回答(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