END misunderstood in MATALAB APP

2 visualizaciones (últimos 30 días)
Stefano Massardi
Stefano Massardi el 26 de Mzo. de 2021
Respondida: Reshma Nerella el 8 de Abr. de 2021
Hi everyone
I have a matlab APP with a part like this:
if (dato1(end,6)==1)
trigger =1;
end
The problem is that the environment automatically thinks that the "END" in dato(end,6) is the one terminating the IF structure. As a consequence, the next end is taken by another thing in the code. This also happens in a while cycle where a statement like:
vector = vector2(end,:)
and that END is taken as the end for the while cycle.
The same code in a script works correctly obviously. Is this an issue of the app?
Thanks
  2 comentarios
dpb
dpb el 27 de Mzo. de 2021
I see similar issue in AppDesigner R2019b -- use of the end keyword definitely seem to confuse the parser.
The workaround would seem to be to use size with the appropriate dimension argument value and/or a temporary variable to store the appropriate value.
Looks worthy of a bug report to me.
Stefano Massardi
Stefano Massardi el 28 de Mzo. de 2021
Yes I indeed solved using dato(length(dato),1)

Iniciar sesión para comentar.

Respuesta aceptada

Reshma Nerella
Reshma Nerella el 8 de Abr. de 2021
Hi,
I understand that clicking on the 'if' is highlighting the wrong end.
This issue is fixed in R2020a Update2.

Más respuestas (0)

Categorías

Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by