Select a range of rows in Excel

30 vues (au cours des 30 derniers jours)
Elles
Elles le 4 Déc 2020
Modifié(e) : Jon le 4 Déc 2020
Hi,
I am trying to select a number of rows from an Excel sheet. For example, selecting only row 90 to row 233. Can someones advice me how to do this? This is the piece of code I'm trying to change.

Réponses (1)

Jon
Jon le 4 Déc 2020
Modifié(e) : Jon le 4 Déc 2020
You should be able to use MATLAB's readmatrix function, e.g
data = readmatrix('myfile.xlsx','Range','90:233')
or if the start and end row numbers are variables
startRow = 90
endRow = 233,
range = [num2str(startRow),':',num2str(endRow)] % build string eg '90:233'
data = readmatrix('myfile.xlsx','Range',range)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by