How to show symbolic equation answer in GUI controllers like static text
Show older comments
Hello,
I'm trying to create application to solve curl of functions that users input in text box and then plot however I cannot achieve to get the static text lable to show the answer. I tried (for simplicity) to assign the equation myself in the editor but it did not work, however when solving something that does not contains symbols (x, y) it works (like log(10)). In troubleshooting I tried to solve diff like that:
syms x
f = sin(5*x)
set(handles.answerTxt, 'String', diff(f));
it didn't work
however when set the answerTxt to
set(handles.answerTxt, 'String', log(10));
it works, so obviously the problem is all about how to pass symbolic equation answer in GUI components.
Thanks
Accepted Answer
More Answers (1)
Azzi Abdelmalek
on 18 Mar 2013
0 votes
6 Comments
Mohamed Mounir
on 18 Mar 2013
Azzi Abdelmalek
on 18 Mar 2013
To update handles
syms x;
f = sin(5*x);
handles.f=f
guidata(hObject,handles);
To get f use
f=handles.f
Mohamed Mounir
on 18 Mar 2013
Azzi Abdelmalek
on 18 Mar 2013
Post the function where you have problems
Walter Roberson
on 18 Mar 2013
Azzi, Mohamed is trying to get a text label to contain the character representation of the differentiation of the symbolic expression "f", not trying to store the symbolic expression itself.
Mohamed Mounir
on 18 Mar 2013
Categories
Find more on Common Operations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!