Error in XLS Read

9 ビュー (過去 30 日間)
Shady Elsayed
Shady Elsayed 2020 年 5 月 13 日
コメント済み: Walter Roberson 2020 年 5 月 14 日
Im am prompted to enter an excel sheet filename then use xlsread to display it on the matlab
I have tried using
F=input('Enter filename')
A=xlsread(F)
But whenever I run the program I receive a message saying that filename was not found even though it works with every other command and I carefully checked the spelling
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 5 月 14 日
F=input('Enter filename ', 's');

サインインしてコメントする。

回答 (1 件)

Geoff Hayes
Geoff Hayes 2020 年 5 月 14 日
Shady - perhaps you need to supply the path to the file? Is the file in the MATLAB search path? Consider using uigetfile so that the user can choose the file that she wants to open. Your code may look something like
[file,path] = uigetfile('*.xlsx')
A=xlsread(fullfile(path,file));

カテゴリ

Help Center および File ExchangeMATLAB Report Generator についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by