based on FT23-Ultra script. fixed for FT24 and FT25
This commit is contained in:
21
assets/savePlot.m
Normal file
21
assets/savePlot.m
Normal file
@ -0,0 +1,21 @@
|
||||
function [outputArg] = savePlot(figure,path,format)
|
||||
|
||||
switch format
|
||||
case "png"
|
||||
savepath = sprintf("%s.png",path);
|
||||
exportgraphics(figure,savepath);
|
||||
case "pdf"
|
||||
savepath = sprintf("%s.pdf",path);
|
||||
exportgraphics(figure,savepath,'ContentType','vector');
|
||||
case "fig"
|
||||
saveas(figure,path,"fig");
|
||||
case "m"
|
||||
saveas(figure,path,"m");
|
||||
otherwise
|
||||
error("invalid filetype");
|
||||
end
|
||||
|
||||
% return null (not relevant for plots!)
|
||||
outputArg = [];
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user