I have two columns of excel data which I want to be imported using xlsread based on certain criteria, but I can only get one column to be selected.
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Kyle Reagan
il 12 Giu 2017
Commentato: Kyle Reagan
il 12 Giu 2017
I have an excel file with two columns. The first is a numerical date column (e.g. 7.3685e+05) and the next column is text corresponding to each date. I have a matlab code which searches the excel date column based on a date > day1 & < day2 which the user specifies using a calendar GUI. The code is shown below. b returns a 3x1 matrix with the correct dates, however the problem is that I want a 3x2 matrix with the text in the second column. Anyone know how to make it return both columns?
day1 = uigetdate;
day2 = uigetdate;
[~,~,rawMN] = xlsread('PracticeFile','sheet1','M500:N703');
b = rawMN(cellfun(@(x) ~isempty(x) && isnumeric(x) && x>= day1 && x <= day2, rawMN));
0 Commenti
Risposta accettata
Fangjun Jiang
il 12 Giu 2017
b = rawMN(cellfun(@(x) ~isempty(x) && isnumeric(x) && x>= day1 && x <= day2, rawMN),:);
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Data Import from MATLAB in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!