I have a problem saving data
    5 views (last 30 days)
  
       Show older comments
    
    Jaime De La Mota Sanchis
 on 4 Jul 2021
  
    
    
    
    
    Commented: Jaime De La Mota Sanchis
 on 16 Jul 2021
            Hello everyone. I have constructed a matlab code which requires the saving of various variables. For that, I have written 
save('realizacionU12A')
 And so on for the various variables which require saving.
However, I am running in the code and getting this error message
Error using save
Can not write file C:\Users\UX490U\Universidad Rey Juan Carlos\Ernesto Staffetti Giammaria -
phd_jaime\article_conflict_detection\experiment\codigoJaimeModificado\50nodosJan2020\realizacionU12B.mat.
Error in apc_and_reconstruction_28_janN2RVSmolyaklvl3 (line 624)
save('realizacionU12B')
Any ideas what can be wrong?
Best regards.
Jaime.
1 Comment
  Mathieu NOE
      
 on 4 Jul 2021
				hello 
the way you use the save function, it will save all your workspace; as explained by the help : 
save(filename) saves all variables from the current workspace in a MATLAB® formatted binary file (MAT-file) called filename. If filename exists, save overwrites the file.
try maybe to save only the variables of interest and not the entire workspace
Accepted Answer
  Sulaymon Eshkabilov
      
 on 4 Jul 2021
        Or save in a different directory, e.g.:
save('C:\Users\..\realizacionU12A')
Change your current directory (cd )  and then save:
More Answers (1)
  Yongjian Feng
    
 on 4 Jul 2021
        Do you have write permission to that folder? If not, try cd to another folder and save there.
See Also
Categories
				Find more on Introduction to Installation and Licensing in Help Center and File Exchange
			
	Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


