Question: When calculating a trigonometric function using Matlab GUI, for example, if I press the 7 button, press the sin button, press the + button, press
When calculating a trigonometric function using Matlab GUI, for example, if I press the button, press the sin button, press the button, press the button, and press the cos button, i want to calculate it as sincos but It is calculated like
cos sin
function btnequationCallbackhObject eventdata, handles
hObject handle to btneq see GCBO
eventdata reserved to be defined in a future version of MATLAB
handles structure with handles and user data see GUIDATA
vgethandlesetxtLCD,'String';
totalevalv;
sethandlesetxtLCD,'String',vnumstrtotal
currentexpression gethandlesetxtLCD, 'String';
try
result evalreplacecurrentexpression, 'sin', 'sind';
sethandlesetxtLCD, 'String', numstrresult;
end
function btnsinCallbackhObject eventdata, handles
hObject handle to btnsin see GCBO
eventdata reserved to be defined in a future version of MATLAB
handles structure with handles and user data see GUIDATA
Hints: gethObject'String' returns contents of btnsin as text
strdoublegethObject'String' returns contents of btnsin as a double
currentvalue gethandlesetxtLCD, 'String';
outputstr sin currentvalue, ;
sethandlesetxtLCD, 'String', outputstr;
guidatahObject handles;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
