What does @(x,y)myFunction mean?
154 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Kristoffer Walker
el 2 de Jul. de 2019
Folks,
Could someone please point me to documentation that explains what the "@(x,y)" means in the below code?
@(x,y)disp('Hello World!')
Similarly, what do the following mean?
StartFcn = @(~,~)myfile
StartFcn = @myfile
StartFcn = {@myfile, 5, 6}
I am trying to get a timer to execute a specific callback in a GUIDE GUI. In order to get this to work, it seems I really need to understand that syntax.
Thank you,
Kris
0 comentarios
Respuesta aceptada
Rik
el 2 de Jul. de 2019
Editada: Rik
el 2 de Jul. de 2019
6 comentarios
Omar Alamoudi
el 20 de Dic. de 2021
I would like to know the name to the question stated by @madhan ravi
Stephen23
el 20 de Dic. de 2021
Editada: Stephen23
el 20 de Dic. de 2021
@Omar Alamoudi: because that anonymous function (and indeed all of the other examples shown in the original question) was written as a callback function for a GUI:
If those two input arguments (object and event) are not used, then they can be ignored, as in that example, but they still need to be defined. It would be better to use tildas for this, which makes the intent clearer.
Más respuestas (0)
Ver también
Categorías
Más información sobre Code Execution en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!