Read 2 specific columns in excel file
Show older comments
Hi, I am quite new to Matlab and have a question about reading specific columnws from excel files. I am interested in column A and G. There is data in the other columns but I am not interested in it. The code follows:
ImportedData{fol_no,file_no} = readtable(char(fullfile(fileInfo(1).folder,fileNames(file_no))));
el=table2array(ImportedData{fol_no,file_no}(:,1,:,7));
I get a message consisting of: You cannot subscript a table using linear indexing (one subscript) or multidimensional indexing (three or more subscripts). Use a row subscript and a variable subscript.
I can import one of the columns, either A or G, but not both simultaneously. I guess the problem is connected to "table2array" as the array only deals with one column?
So my question to you is- how can I import the columns simultenously? Pleaste note that I am performing this procedure for a no.of files
Accepted Answer
More Answers (0)
Categories
Find more on Data Import from MATLAB 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!