Matlab GUI edit text 'pi' and mathematical operations
Show older comments
If a person decides to enter 'pi' into the edit box, is there a way to convert the string 'pi' into its numerical value? So right now the callback function looks like:
a = str2double(get(handles.editbox,'string'));
When a value is entered, e.g. '2', the function str2double converts the string '2' into its numerical value. Is it possible to achieve something like this with 'pi' or other matlab built-in constants?
Also, is there a way to input mathematical operations into the edit boxes? Say I input 'pi/2' into the text box. Is there a way to 'compute' this string and convert it to its numerical value?
Accepted Answer
More Answers (0)
Categories
Find more on Data Type Identification in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!