Taking a system as input in MATLAB App Designer
1 view (last 30 days)
Show older comments
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?
0 Comments
Answers (0)
See Also
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!