Readtable function on Matlab

조회 수: 4 (최근 30일)
Alfin Kunjumon Joseph
Alfin Kunjumon Joseph 2020년 12월 1일
댓글: KENMOGNE KUITEING ANNA 2023년 10월 30일
Hi I am trying to get some data from excel into matlab and when I use the:
%% Load data
T = readtable("Task3.xlsx","Sheet1","Data");
script it does not seem to work when i run that section and comes up with errors:
Error using readtable (line 198)
Unable to find or open 'Task3.xlsx'. Check the path and filename or file permissions.
Error in Task3_MatlabScript (line 4)
T = readtable("Task3.xlsx","Sheet1","Time[s]");
If anyone can point me in the right direction and explain why this is occuring that would be of such great help.
Many thanks.

답변 (2개)

Image Analyst
Image Analyst 2020년 12월 1일
You need to add parameters, like
T = readtable('Task3.xlsx', 'Sheet', 'Sheet1', 'A1');
Read the help for readtable for special spreadsheet options.
  댓글 수: 1
Alfin Kunjumon Joseph
Alfin Kunjumon Joseph 2020년 12월 1일
Hi thank you for your response, I have tried that too and it still is not working I have looked at the help option on Mathworks and when I try that it does not work for some reason. I have tried to run this a million times haha and it still is not working so frustrating.

댓글을 달려면 로그인하십시오.


Walter Roberson
Walter Roberson 2020년 12월 1일
편집: Walter Roberson 2020년 12월 1일
Unable to find or open 'Task3.xlsx'
Task3.xlsx is not in your current directory, and not in any directory that is on the MATLAB path.
If it is in a different directory, you need to provide the absolute or relative path for it.
If you used something like
[filename, pathname] = uigetfile('*.xlsx', 'Choose a .xlsx file');
then you need to use
fullname = fullfile(pathname, filename);
T = readtable(fullname, 'Sheet', 'Data');

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by