|
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 ".*".
|