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

32 visualizzazioni (ultimi 30 giorni)
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);

Risposta accettata

Cris LaPierre
Cris LaPierre il 15 Feb 2021
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 Commenti
John Carroll
John Carroll il 15 Feb 2021
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 il 15 Feb 2021
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",

Accedi per commentare.

Più risposte (0)

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by