Borrar filtros
Borrar filtros

Taking a system as input in MATLAB App Designer

1 visualización (últimos 30 días)
Krishnaraja Sagar
Krishnaraja Sagar el 26 de Nov. de 2020
I need to extract a system function from the data typed by the user into a text box.
function out_sig = systemSelector(app,x,t)
sys_strstart = '@(x,t)';
sys_string = app.SystemyEditField.Value;
sys_string = strcat(sys_strstart,sys_string);
sys_handler = str2func(sys_string);
out_sig = sys_handler(x,t);
end
This is the function I wrote which takes the input provided by the user in terms of x and t.
But, for this to work, I have to provide strings like 't.*x' and '(t.*3).*(x.^2)' which are not user-friendly. Besides the user cannot enter systems which have a delay, like 'x(t-5)'.
Can anyone please suggest a new function or update my existing function so that I can take the input in a better manner?

Respuestas (0)

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