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

1 次查看(过去 30 天)
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 个评论
Tommy
Tommy 2020-4-13
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?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by