read multiple columns from an excel spreadsheet by using xlsread
69 views (last 30 days)
I have an Excel sheet with 300 columns, from which I just need several ranges. In a normal case I use the "import data" app. But this time it is not possible, because some of the strings are double. I just want to read in the first row and from this, several columns (all strings).
Just as an example:
I have a first row with strings like this:
x= ["'[23Na]+'" , "'[24Mg]+'" , "'[25Mg]+'" , "'[26Mg]+'" , "'[26Mg]++'" , "'[27Al]+'" , "'C2H3+'" , "'[28Si]+'"]
And now I just want to have A1:B1 and E1:F1. How do I use here xlsread with several ranges to end with a string like this:
x= ["'[23Na]+'" , "'[24Mg]+'" , "'[26Mg]++'" , "'[27Al]+'"]
I am grateful for every hint.
Arif Hoq on 29 Mar 2022
I guess you can not export multiple ranges data in Matlab.
Range must be of the form 'A1' (cell), 'A:B' (column-select), '1:5' (row-select), 'A1:B5' (rectangle-select), or a valid named range in the sheet.
Either you can export your data in multiple variable with range
or use readtable then process your data