Error in XLS Read

조회 수: 7 (최근 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 CenterFile Exchange에서 MATLAB Report Generator에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by