Calling clear to clear all variables is rarely necessary in a function.
Mat file not loading all variables.
The mat file object does not support evaluating function handles using the m output.
What i don t understnad is the reason why it s corrupt.
I could use the same file before.
That way the name of.
This allows you to avoid conflicts with variables that already existed in the workspace.
I recommend you use this approach.
If you call load with an output argument the output argument will be a struct array and the variables that were in the mat file will be read into fields in that output argument.
I recommend you use this approach.
When saving a handle object matlab saves a copy of the object not a copy of the handle.
The mat file object does not support evaluating function handles using the m output.
If you call load with an output argument the output argument will be a struct array and the variables that were in the mat file will be read into fields in that output argument.
For example if your mat file contains function handle myfunc the syntax m myfunc attempts to index into the function handle and does not invoke the function.
Most of time only one of them is corrupt so i can load other variables successfully.
For my mat file it contains four variables.
For example if your mat file contains function handle myfunc the syntax m myfunc attempts to index into the function handle and does not invoke the function.
And this situation happens a lot especially for those large file.
Calling clear to clear all variables is rarely necessary in a function.