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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |