how to do structs from excel in matlab?
Show older comments
how can we do a struct that contains the data from a sheet from excel with strings and numbers
Answers (1)
Image Analyst
on 21 Dec 2021
You can do
[numbers, strings, rawCA] = xlsread(fileName);
to get data from Excel. To put that into a structure variable in MATLAB you need to manually assign the fields, like if s is your structure
s.numbers = numbers;
s.strings = strings;
s.ca = rawCA;
Now s is a structure.
Categories
Find more on Spreadsheets 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!