Unable to use xlsread to open a file
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Meghana Balasubramanian
il 28 Ago 2019
Risposto: Bruno Luong
il 28 Ago 2019
Hey everyone,
I'm trying to run the follwing code:
for i=1:10
fil_length= xlsread('\\some_pathway_here\Filament_Length_Data\Filament_Length_',num2str(i),'.xls')
end
However, I get an error: Error using xlsread (line 132)
XLSREAD unable to open file '\\some_pathway_here\Filament_Length_Data\Filament_Length_'.
File '\\some_pathway_here\Filament_Length_Data\Filament_Length_' not found.
When I run this code:
fil_length= xlsread('\\some_pathway_here\Filament_Length_Data\Filament_Length_1.xls')
without the num2str(i) part, I'm able to read the file. Is it not possible to run a function such as this? If not, are there any other ways that i could access my excel files inside a loop?
Risposta accettata
Bruno Luong
il 28 Ago 2019
for i=1:10
fil_length= xlsread(['\\some_pathway_here\Filament_Length_Dat\Filament_Length_' num2str(i) '.xls'])
end
0 Commenti
Più risposte (1)
darova
il 28 Ago 2019
![2Untitled.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/235521/2Untitled.png)
1 Commento
Walter Roberson
il 28 Ago 2019
No, initial \\ in Windows indicates a path for network access, and is proper.
Vedere anche
Categorie
Scopri di più su Spreadsheets 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!