Invalid expression.Unable to resolve the name
1 次查看(过去 30 天)
显示 更早的评论
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.
采纳的回答
Walter Roberson
2022-8-2
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'
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!