How do you use the solve function in a mat lab GUI?
2 views (last 30 days)
A have made a GUI app in Matlab and I am trying to put in a solve function for two variables with two equatios but I am getting the error message that it does not recognize the function 'solve.'
Thi is my code for the button, that when clicked, calculates the time it takes:
All preperties have been defined and I have tried putting the line
system c t
instead but then it wouldn't recognize the values c and t in the solve function.
If anyone knows how to make the solve funtion work or how to use a seperate method that would achieve the same goal I would apreicate any help.
Steven Lord on 8 Dec 2022
Are you attempting to define app.c and app.t as symbolic variables using these lines?
That won't work; that calls the system function instead, and likely either throws an error (because there is no app command / executable for the operating system to run) or does something you probably don't expect.
Instead define symbolic variables and use them in your solve call:
c = sym('c');
t = sym('t');