What is "The left-hand side of a . operator must be a valid scope identifier" error for? And how to solve this?
Show older comments
Hi,
I am trying to perform SIL testing and while executing the test cases, I get the following error:
"Error: File: C:\Program Files\MATLAB\R2018b\rtw\c\tlc\mw\capi.tlc Line: 1200 Column: 53
The left-hand side of a . operator must be a valid scope identifier"
Initially, I developed test cases for MIL environment which I could execute without any error. Now, I changed the harness for SIL testing and trying to execute the same test cases but, getting above-mentioned error.
I am testing the SW by creating the test harness, test cases were developed using unittest in MATLAB and were executed by the test manager.
Can anyone please help me with that?
Thank you,
Parin

Accepted Answer
More Answers (2)
Walter Roberson
on 6 Aug 2021
0 votes
Notice the message about dot indexing not supported.
The most common reason for that message is that some operation returned [] when you expected it to return a struct or an object.
However it can also occur if a variable that was a struct or object was overwritten with a numeric object. It can also occur if the variable previously existed as a numeric object and the code that you expected to overwrite it with a struct or object does not do so.
9 Comments
Parin Shah
on 6 Aug 2021
Edited: Parin Shah
on 7 Aug 2021
Walter Roberson
on 7 Aug 2021
I just installed R2018b on Windows with RTW... but the named file does not exist. The structure of the installed directories does not have a folder named rtw directly under the MATLAB installation directory: instead the rtw folder is underneath a folder named toolbox in the MATLAB directory.
It is possible that the file name reflects an internal Mathworks build; if that is the case then you will need to open a case with Mathworks.
Could you check to see if you have that row\c\tic\mw directory on your machine?
Parin Shah
on 7 Aug 2021
Walter Roberson
on 7 Aug 2021
Odd.. I wonder if you are somehow writing your project underneath the MATLAB installation directory?
Or perhaps it has to do with a support package you have installed ??
Parin Shah
on 7 Aug 2021
Walter Roberson
on 7 Aug 2021
I see that you edited the name of the missing file. Before the directory name was tic and now it is tlc. Before the file name was capitol with no file extension; now it is capi.tlc . Those details are important.
I will have another look for the file.
Parin Shah
on 7 Aug 2021
Walter Roberson
on 7 Aug 2021
I found the file. Line 1200 is
%foreach dwkIdx = Block[blkIdx].ChartData.NumChartData
and that would fail if Block[blkIdx].ChartData is empty.
I do not see anything in the code that sets the ChartData field, so I do not know at the moment where that is coming from.
Parin Shah
on 8 Aug 2021
Dean D.
on 5 Jan 2024
0 votes
I noticed this in R2019b as well, and was able to resolve it by disabling the link to some of my library blocks, and then breaking said links. I was able to rebuild and not get the issue mentioned above.
Categories
Find more on Results, Reporting, and Test File Management in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!