MATLAB Answers

Mathematical symbols in matlab

96 views (last 30 days)
Pedro Andalon
Pedro Andalon on 2 Dec 2019
Commented: Luna on 3 Dec 2019
Hi everyone,
I wrote a program with GUI and I can't display a mathematical symbol in a static text field, is this possible?
Thank you!

  0 Comments

Sign in to comment.

Accepted Answer

Luna
Luna on 2 Dec 2019
Edited: Luna on 2 Dec 2019
Hi,
Check this:
You should be writing in latex format.

  3 Comments

Pedro Andalon
Pedro Andalon on 2 Dec 2019
Luna thank you much for your response,
I will be more specific on what I am doing: on GUI I create a popupmenu with 6 different options,
Options:
1- empty
2- + (Addition)
3- - (Subtraction)
4- * (Multiplication)
5- / (Divition)
6- Pwr (Exponent)
I want to plot/pase/write any of these mathematic symbols only into a Static text.
I am attaching my code
option=get(handles.popupmenu1, 'Value');
a= '+';
b= '-';
c= '*';
d= '/';
e= 'E';
if option==2
Addition(handles.text3,a);
end
if option==3
Subtraction(handles.text3,b);
end
if option ==4
Multiplication(handles.text3,c);
end
if option==5
Division(handles.text3,d);
end
if option==6
Power(handles.text3,e);
end
Pedro Andalon
Pedro Andalon on 3 Dec 2019
Found the answer thanks for replying back to my question.
I am attaching my solution in case it can help somebody else.
option=get(handles.popupmenu1, 'Value');
a= '+';
b= '-';
c= '*';
d= '/';
e= '^';
if option==2
set(handles.text3,'String',a);
end
if option==3
set(handles.text3,'String',b);
end
if option ==4
set(handles.text3,'String',c);
end
if option==5
set(handles.text3,'String',d);
end
if option==6
Luna
Luna on 3 Dec 2019
Your welcome :) And thanks for sharing your solution aswell.

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Tags