Programmatically Change Preferences?
28 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
meghannmarie
am 15 Sep. 2020
Bearbeitet: Stefanie Schwarz
am 28 Mär. 2023
How do I promatically change preferences? I am running a script from command line in linux (on a HPC). I am using a tall array and I am getting this error: "Error using matlab.mapreduce.internal.Serializer/writeToMatfile (line 44). Unable to write to MAT-file because one of the values exceeds the size limit. Ensure each value is less than 2GB or use a Hadoop location." I think I may have to set my preferences to save matfiles as version 7.3. How do I do that in a script?
I tried this on my windows machine and it does not seem to work.
pref = regexp( fileread(fullfile(prefdir,'matlab.prf')), '\n', 'split');
loc = find(~cellfun(@isempty,regexp(pref,'MatfileSaveFormat=')));
if isempty(loc); pref{end+1} = 'MatfileSaveFormat=Sv7.3';
else; pref{loc} = 'MatfileSaveFormat=Sv7.3';
end
fid = fopen(fullfile(prefdir,'matlab.prf'), 'w');
fprintf(fid, '%s\n', pref{:});
fclose(fid);
Any ideas?
0 Kommentare
Akzeptierte Antwort
Fangjun Jiang
am 15 Sep. 2020
Bearbeitet: Stefanie Schwarz
am 28 Mär. 2023
to save matfiles as version 7.3, use save(FILENAME, ..., VERSION)
to set MATLAB preference, https://www.mathworks.com/help/releases/R2020a/matlab/matlab_external/access-and-modify-settings.html
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Desktop finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!