Bug about saving a variable
7 views (last 30 days)
i am experiencing a very strange bug in saving a variable.
Supposing variable name is "xxxxx"
if i execute the instruction
save filetarget xxxxx (which should save the xxxxx variable in the filetarget.mat file)
and then i execute
i receive the following error message: Error using ==>load Unable to read MAT-file C:\....filetarget.mat File may be corrupt
but if i create a variable with a shorter name, that is
and then i execute save filetarget x and then load filetarget
what can it be??
Thanks in advice!!!!
Naz on 19 Dec 2011
yourfile='name.mat'; %saves in the current directory
save yourfile x
Strange... I don't get an error when using variable xxxxx. Maybe matlab has an issue with the path where you want to save it? Try saving it in the current directory first.
Try using this set:
where the 'new' variable will be a struct containing your variable xxxxx. To access it, you need this reference:
Jose Jeremias Caballero on 19 Dec 2011
>> save filetarget xxxxxxx
>> clear all
>> load filetarget
Name Size Bytes Class Attributes
xxxxxxx 3x3 72 double
0.4898 0.7094 0.6797
0.4456 0.7547 0.6551
0.6463 0.2760 0.1626