Writing a struct to a designated XLS sheet.
Show older comments
I have been able to write a struct to an xls file using export() but I have not been able to specify a sheet name for it to write to. first, is there an easy way to do that? if not then this brings me to use xlswrite() but i have a hard time organizing my data in a usable format for this function. My struct looks like this:
Data = struct('Activity', activityData, 'Radar', uutData, 'TimeElapsed', timeElapsed, 'TestPoint1', testPoint1, 'TestPoint2', testPoint2);
activityData and uutData is a different size of characters and testPoint1 and testPoint2 and time Elapsed are doubles. All have the same number of rows so this works as a struct. but to put it in a usable format for xlswrite() i had to use cellstr() for each of the character arrays becuase i got vertCat errors when performing this line: Data ={'Activity ', activityData; 'Radar ' ,uutData; 'TimeElaps ', timeElapsed;'TestPoint1', testPoint1;'TestPoint2',testPoint2};
This works and i get: Data = 'Activity ' 'Radar ' 'TimeElaps ' 'TestPoint1' 'TestPoint2' {500x1 cell} {500x1 cell} [500x1 double] [500x1 double] [500x1 double]
My problem is when i use: xlswrite('test.xls',Data, tempDate);
i don't get anything from whats inside the {500x1 cell}. How can i get this in my data in the file?
Answers (0)
Categories
Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!