

If you want column headers in your csv, it gets complicated because csvwrite can only handle numeric arrays: celldata = num2cell(num2str(data_Centroid)) %// create cell arrayĬelldata(:,3) = celldata(:,4) %// copy col 4 (y data) into col 3 (spaces)Ĭelldata Ĭsvwrite_with_headers(strcat(PlateName, '_ResultsFeatures.


I.e., the command: foo(1) sends the first of the structs to the screen, but the structure is too large to fit in the scroll window, and the scroll window is a poor tool for looking at such a large block of text, anyway. In this case, this means extracting the values you want to save, (split the array,) then save the data: data_Centroid = vertcat(vWFfeatures.Centroid) %// contains the centroid dataĬentroid_X = data_Centroid(:,1) %// The first column is XĬentroid_Y = data_Centroid(:,2) %// the second column is YĬsvwrite('centroid.csv',data_Centroid) %// writes values into csv The structs are sufficiently large that I would like to be able to print the text representations to a text file for later study. Repetition is superfluous in use, as shown in the example. For more information, see Structure Arrays or watch Introducing Structures and Cell Arrays. Access data in a structure using dot notation of the form structName.fieldName. The name of the structure is implicit, and need not be included in a fieldname. A structure array is a data type that groups related data using data containers called fields. This usage is consistent with C++ practice, and it helps to distinguish between structures and ordinary variables. Since the original struct2table isn't available to you, you might want to implement specifically the behavior you're trying to achieve yourself. Structures Structure names should begin with a capital letter.
