

The Save As dialog box you access from the figure window's File menu uses saveas, limiting the file extensions to m and fig. You can use open to open files saved using saveas with an m or fig extension. When using the print device type to specify format for saveas, do not use the prepended -d. Use an extension from the table above or from the list of device types supported by print. The print device types include the formats listed in the table of extensions above as well as additional file formats. If no extension is specified, the standard extension corresponding to the specified format is automatically appended to the filename.Īllowable values for format are the extensions in the table above and the device types supported by print. The filename can have an extension but the extension is not used to define the file format. Saves the figure or model with the handle h to the file called filename using the specified format. MATLAB M-file (invalid for MATLAB models)


MATLAB figure (invalid for MATLAB models) Allowable values for ext are listed in this table. The format of the file is determined by the extension, ext. Saves the figure or model with the handle h to the file filename.ext. Save figure or model using specified format

I though it might have been due to size limitations, but I tried to duplicate the original structure a few times until it was 1 x 20000, and it saved just fine.Saveas (MATLAB Functions) MATLAB Function Reference I can use imageStruct normally, and there doesn't seem to be any difference between the original and the newly created version, besides the added data. A file named 'imageStruct.mat' will be created, but it is empty. If i than use save('imageStruct.mat','imageStruct') again, it will not save data. ImageStruct(length(imageStruct)).webLink = metData.var8(i) ImageStruct(length(imageStruct)).orginalCollection = metData.var7(i) ImageStruct(length(imageStruct)).principalOrFirstMaker = metData.var6(i) ImageStruct(length(imageStruct)).date = metData.var5(i) ImageStruct(length(imageStruct)).medium = metData.var4(i) ImageStruct(length(imageStruct)).productionPlaces = metData.var3 ImageStruct(length(imageStruct)).title = metData.var2(i) ImageStruct(length(imageStruct)+1).objectNumber = char(metData.var1(i)) >metData = readtable('meta_data_metropolitan_paintings.txt','FileEncoding','UTF-8','Delimiter','\t') Next, I add data to imageStruct, which increased it to a 1 x 11496 struct array. I can save this variable from my Workspace by using: save('imageStruct.mat','imageStruct')Īnd I can also load it into my Workspace again: > clc I have a script with which I create a matlab struct. For later readers, if save() doesn't return an error, but saves an empty file it's possibly a saving directory that's too small. EDIT: It turns out that the saving location wasn't large enough to hold the file.
