Argument to dynamic structure reference must evaluate to a valid field name.

1 view (last 30 days)
I am working on matlab app designer and I have the same code running normally and running through the app designer. The error message mentioned in the tittle seems to be very inconcistent when im running the code on the editor tab as it appears and disappears randomly without changing anything in the code. However, in the matlab app designer, the error message is consistent and is generated by the following line of code where SW and FL are 1x1 table elements.
GSD=((SW.(1))*Alt)/((FL.(1))*IW);
If you could please help me out with resolving this issue or with a method of getting the number out of the 1x1 table into a regular value.
Please advise,
Thank You,
  1 Comment
Tommy
Tommy on 13 Apr 2020
It's possible that MATLAB does not think SW and FL are tables and therefore treats them as structs when you call SW.(1). If you use
GSD=((SW{1,1})*Alt)/((FL{1,1})*IW);
do you still get an error, and is the error different?

Sign in to comment.

Answers (0)

Categories

Find more on Develop Apps Using App Designer 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!