I often write user interfaces that require user to input
analytical functions into edit boxes.
But I haven't found a MATLAB function specificially designed
to handle the scenario.
I tried different ways to acoomplish this:
1. I tried the subs function from symbolic math toolbox -
it's roubust, but is veeeery slow ((
2. Now I use eval. But it requires users to input
expressions using non-matrix operators like .+ .* etc.
Moreover, eval is not robust at all: users are able to
execute almost any MATLAB command inside my UI. Yet, eval is
not as fast as I want.
Any suggestions?
TIA
Subject: evaluating expressions obtained from UI. eval alternative
"Ilya " <ilyapoz@gmail.com> wrote in message
<frfhl6$6ov$1@fred.mathworks.com>...
> I often write user interfaces that require user to input
> analytical functions into edit boxes.
> But I haven't found a MATLAB function specificially designed
> to handle the scenario.
>
> I tried different ways to acoomplish this:
> 1. I tried the subs function from symbolic math toolbox -
> it's roubust, but is veeeery slow ((
>
> 2. Now I use eval. But it requires users to input
> expressions using non-matrix operators like .+ .* etc.
> Moreover, eval is not robust at all: users are able to
> execute almost any MATLAB command inside my UI. Yet, eval is
> not as fast as I want.
>
> Any suggestions?
> TIA
>
could you use inline?
Subject: evaluating expressions obtained from UI. eval alternative
On 2008-03-15 14:39:05 -0400, "Dan Haeg" <haegd@msoe.edu> said:
> "Ilya " <ilyapoz@gmail.com> wrote in message
> <frfhl6$6ov$1@fred.mathworks.com>...
>> I often write user interfaces that require user to input
>> analytical functions into edit boxes.
>> But I haven't found a MATLAB function specificially designed
>> to handle the scenario.
>>
>> I tried different ways to acoomplish this:
>> 1. I tried the subs function from symbolic math toolbox -
>> it's roubust, but is veeeery slow ((
>>
>> 2. Now I use eval. But it requires users to input
>> expressions using non-matrix operators like .+ .* etc.
>> Moreover, eval is not robust at all: users are able to
>> execute almost any MATLAB command inside my UI. Yet, eval is
>> not as fast as I want.
>>
>> Any suggestions?
>> TIA
>>
>
> could you use inline?
Also, you might find the "vectorize" function helpful. It will take a
string or inline function and convert operations like "*" into ".*".
Subject: evaluating expressions obtained from UI. eval alternative
> > could you use inline?
>
> Also, you might find the "vectorize" function helpful. It
will take a
> string or inline function and convert operations like "*"
into ".*".
Thank you very much! Wonder, why I haven't heard anything
about the "inline" func ((
Subject: evaluating expressions obtained from UI. eval alternative
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.