MATLAB: Converting rad to deg in a static text box GUI

angledegreesguiMATLABradiansradtodeg

I have a edit text box which the user will put the radians in, then i want the static text box to the side of it to show the value in degrees automatically. I have tried:
set(handles.text6_camberdeg,'String',angledim((get(handles.edit4_camberrad,'String')),'radians','degrees'));
my edit text box is tagged: edit4_camberrad my static text box is tagged: text6_camberdeg

Best Answer

The problem is that you are passing ANGLEDIM a string and expecting a string output. It takes and returns doubles, not strings.
D = str2double(get(handles.edit4_camberrad,'String'))*180/pi;
set(handles.text6_camberdeg,'String',num2str(D));