Invalid expression.Unable to resolve the name

7 vues (au cours des 30 derniers jours)
Santosh Biradar
Santosh Biradar le 2 Août 2022
Commenté : Santosh Biradar le 2 Août 2022
Hello
[num,txt,raw] = xlsread('SummaryResult.xlsx','AAA_SheetName');
newlyAdded = readtable('SummaryResult.xlsx', 'Sheet', ''AAA_SheetName','Range','A2:D40','TextType','string');
NewData = num2str(t.BLFFileName)+"_"+num2str(t.Time_sec_);
As Excel is having Column name as "BLF File Name". As it is having space between the words. Unble to read the space.
Unable to resolve the name c.BLFFileName.
Error: Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax
error. To construct matrices, use brackets instead of parentheses.
I tried with different expression as
num2str(t.('BLF File Name'))+"_"+num2str(t.Time_sec_);
num2str(t.('BLFFileName'))+"_"+num2str(t.Time_sec_);
num2str(t.('BLF_File_Name'))+"_"+num2str(t.Time_sec_);
num2str(t.'BLF_File_Name')+"_"+num2str(t.Time_sec_);
num2str(t.(BLF_File_Name))+"_"+num2str(t.Time_sec_);
for all, showing same error msg.
Thank you
Brief Work
Please let me know for brief.

Réponse acceptée

Walter Roberson
Walter Roberson le 2 Août 2022
in your r2019b release add the readable option 'PreserveVariableNames', true
and use t.('BLF File Name')
Note that PreserveVariableNames option was changed in a later release to 'VariableNamingRule', 'preserve'

Plus de réponses (0)

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by