필터 지우기
필터 지우기

My code is Unable to read my table that is in workspace. Any Help will be much appreciated

조회 수: 29 (최근 30일)
Feb 14, 2021 2:50:31 PM com.jidesoft.plaf.aqua.AquaPreferences loadGlobalPreferences
WARNING: AquaPreferences failed to load Mac OS X global system preferences - parseInt: unsupported byte count:16
>> Lab1
Error using readtable (line 245)
Unable to find or open 'WH'. Check the path and filename or file permissions.
Error in Lab1 (line 6)
X = readtable('WH','Range','A2:A39'); %importing X values into vector
CODE :
%Code for Waves Lab 1 Data
X = readtable('WH','Range','A2:A39'); %importing X values into vector
X1 = table2array(X);
Y0 = readtable('WH','Range','B2:B39'); %importing Y original values into vector
Y01 = table2array(Y0);
YW = readtable('WH','Range','C2:C39'); %importing Y winter values into vector
YW1 = table2array(YW);
YS = readtable('WH','Range','D2:D39'); %importing Y summer values into vector
YS1 = table2array(YS);

채택된 답변

Cris LaPierre
Cris LaPierre 2021년 2월 15일
Your file appears to be missing an extension. What type of file is WH? Try adding that to your readtable command. For example, if it were an Excel spreadsheet, I'd do the following.
X = readtable('WH.xlsx','Range','A2:A39'); %importing X values into vector
If that still doesn't work, please attach your file to your post using the paperclip icon.
  댓글 수: 2
John Carroll
John Carroll 2021년 2월 15일
I was able to add this extension however i am still reciving the following error:
Error using readtable (line 245)
Unable to find or open 'WH.xlsx'. Check the path and filename or file permissions.
Error in Lab1 (line 6)
X = readtable('WH.xlsx','Range','A2:A39'); %importing X values into vector
code:
%Code for Waves Lab 1 Data
X = readtable('WH.xlsx','Range','A2:A39'); %importing X values into vector
X1 = table2array(X);
Y0 = readtable('WH.xlsx','Range','B2:B39'); %importing Y original values into vector
Y01 = table2array(Y0);
YW = readtable('WH.xlsx','Range','C2:C39'); %importing Y winter values into vector
YW1 = table2array(YW);
YS = readtable('WH.xlsx','Range','D2:D39'); %importing Y summer values into vector
Cris LaPierre
Cris LaPierre 2021년 2월 15일
When I try to download then open the file, the actual name appears to be "_WH.xlsx".
Try using the actual file name, or rename the file to "WH.xlsx",

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by