Invalid expression.Unable to resolve the name

1 回表示 (過去 30 日間)
Santosh Biradar
Santosh Biradar 2022 年 8 月 2 日
コメント済み: Santosh Biradar 2022 年 8 月 2 日
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.
  1 件のコメント
Walter Roberson
Walter Roberson 2022 年 8 月 2 日
t is not defined in the code

サインインしてコメントする。

採用された回答

Walter Roberson
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'
  1 件のコメント
Santosh Biradar
Santosh Biradar 2022 年 8 月 2 日
Thank you so much @Walter Roberson
Now it is working.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by