lola
lola

Reputation: 5789

save_system on non writable file MATLAB command

I try to save mdl in old fomart

save_system(fullfile(fullpath, myModel(k).name), fullfile(fullpath, myModel(k).name),'SaveAsVersion', 'R2011b');

I'm getting an error saying that the file I'm trying to save is not writable how could I make it writable ? I don't find a similar arg as for copyfile(...'f')

any idea ?

Thanks,

Upvotes: 1

Views: 834

Answers (1)

Daniel
Daniel

Reputation: 36710

There is a function to modify file attributes:

fname=fullfile(fullpath, myModel(k).name);
fileattrib(fname,'+w');

You could also use java:

fname=fullfile(fullpath, myModel(k).name);
java.io.File(fname).setWritable(true)

Upvotes: 1

Related Questions