Creating variables based on number of columns?
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Nicholas DeGarmo
am 13 Apr. 2020
Beantwortet: Steven Lord
am 13 Apr. 2020
So I have a project I am working on, and I have to import an excel sheet where the first column is just dates, and every column after that contains data with the first row containing the name of the data. How can I in my script create varibles for each column, and have it be expandable? Lets say I have to use a different data sheet that only have 5 columns instead of 8. What would be the best way to go about doing this? I also need to manipulate the data but I have no idea how to even assign the data to variables to manipulate it.
0 Kommentare
Akzeptierte Antwort
Steven Lord
am 13 Apr. 2020
How can I in my script create varibles for each column, and have it be expandable?
CAN you do this? Yes. SHOULD you do this? NO.
Instead I recommend reading your data into a table or timetable array using either readtable (possibly calling table2timetable on the resulting table) or (if you're using release R2019a or later) readtimetable. There are a number of ways to access the data in a table or timetable, including selecting a set of rows in a range of times, for timetable arrays.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!