Can I pass arguments to a @callbackFcn?
Mostrar comentarios más antiguos
Hello,
I am reading some data from a serialport by using this function:
configureCallback(s,"terminator",@readSerialData)
The function looking like this
function readSerialData(s,~)
...
end
But how can I do to use arguments in the @readSerialData, for example I want to use this two arguments
function readSerialData(s,~,operation,mode)
...
end
How can I "pass" these two variables from the "configureCallback" line to the function?
Thank you!!
1 comentario
Rik
el 29 de Jul. de 2021
Respuesta aceptada
Más respuestas (1)
Bruno Luong
el 29 de Jul. de 2021
% Assuming operation,mode are defined
% operation = ...
% mode = ...
configureCallback(s,"terminator",@(s,t) readSerialData(s, t, operation, mode));
1 comentario
Javier Mateo
el 30 de Jul. de 2021
Categorías
Más información sobre Serial and USB Communication en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!