MATLAB Answers

Readtable error help?

149 views (last 30 days)
Leon
Leon on 22 Mar 2020
Answered: Agneyan Dileep on 28 Jul 2020
Here is my code and attached is my test.xlsx.
clear all
close all
clc
A = readtable('test.xlsx', 'FY20', 'PreserveVariableNames',true);
Why do I keep getting the below error:
Error using readtable (line 229)
All parameters must have an associated value.
Error in Generate_html (line 5)
A = readtable('test.xlsx', 'FY20', 'PreserveVariableNames',true);
Thanks
  2 Comments
Leon
Leon on 22 Mar 2020
Thanks. FY20 is the worksheet and I just tried the error remains.

Sign in to comment.

Accepted Answer

Guillaume
Guillaume on 22 Mar 2020
I suspect to your 'FY20' is meant to be the sheet name. Unlike xlsread, with readtable the sheet name is passed as a Name-Parameter argument:
A = readtable('test.xlsx', 'Sheet', 'FY20', 'PreserveVariableNames',true);
  1 Comment
Leon
Leon on 22 Mar 2020
Many thanks!

Sign in to comment.

More Answers (1)

Agneyan Dileep
Agneyan Dileep on 28 Jul 2020
Error using readtable (line 198)
All parameters must have an associated value.
Error in GTM (line 13)
T = readtable('Data Values.xlsx','Sheet','PreserveVariableNames',true);
I am also getting a similar error. Please help.

Tags

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by