xlsread error, wont open file
14 ビュー (過去 30 日間)
古いコメントを表示
Error using xlsread (line 139)
XLSREAD unable to open file 'Prelab'.
File 'Prelab' not found.
Error in Prelab (line 5)
A1 = xlsread('Prelab',1,'A2:A16');
I have used this method a few times now but it is not working for this file, any ideas?
clc, clear, close all;
path = 'C:\Users\Anthony\Desktop\220 Lab' ;
filename = 'Prelab.xlsx' ;
fullpath = [path, '\', filename];
A1 = xlsread('Prelab',1,'A2:A16');
B1 = xlsread('Prelab',1,'B2:B16')*10^-3;
plot(A1,B1);
xlabel('load (gr-Kg-lbs');
ylabel('Deflection (in)');
title('Load (gr) vs. Deflection (in)');
回答 (3 件)
Star Strider
2018 年 11 月 15 日
A guess:
A1 = xlsread(fullpath,1,'A2:A16');
B1 = xlsread(fullpath,1,'B2:B16')*1E-3;
0 件のコメント
madhan ravi
2018 年 11 月 15 日
Make sure Prelab excel file is there in the path as the error message clearly states that there is no such file
Luna
2018 年 11 月 15 日
編集済み: Luna
2018 年 11 月 15 日
Hello Anthony
check the inputs of xlsread function.
First input should be the full file name with path or if your matlab‘s current path is the same directory that contains your excel, the first input can be the file name with its extension.
For example:
xlsread(‘C:\Users\Desktop\myExcel.xls’,.. etc)
xlsread(‘myExcel.xls’,etc)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Import from MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!