Setappdata data type specification

1 view (last 30 days)
Matthew
Matthew on 30 Oct 2012
Can your force setappdata to make the specified value a specific type of data?
The program I am creating uses the eval command to execute a potential entered string, however, if a user enters a number MATLAB recognizes it as a double and will not evaluate. Is there anyway to force setappdata to create the floating point number as a string (or maybe a Char array) that can be evaluated safely?
Ex:
setappdata(0,'Item1','-0.863');
Where later I would like Item1 to be a string that when executed returns just -0.863.
On a secondary note, the negative number seems to be passed fine, but positive ones are not and kicked back with the data type double error. Is Matlab Recognizing the negative as a ( zero minus a number )?

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!