- How can I ask a user to input a function ( of say : t) and store it as a symbolic function?
- And after that I want to store all the symbolic functions in an array:
Let's say my first function is :
f1 ( and I have gotten information of f1 by user in step 1 as f1=t)second one is :f2 (and I have gotten information of f2 by user in step 1 as f2=t^2)Now I want to make an arrayA= [ f1, f2]
such that I when I call A(2) it gives me f2 which in turn gives for e.g. 4 when I write f2(2)
I already know how to get input as an inline function and by using this program (http://www.mathworks.com/matlabcentral/fileexchange/33025-convert-inline-to-symbolic/content/inline2sym.m) I am converting it to sym. But I want an easier way if it exists.
inlinefunctions at all –they're inefficient and as the documentation states, deprecated. You don't need anything more thansymorsymfunand basic Matlab arrays or cells to do what you describe. - horchlersymfunis not possible, you have to use a cell array. - Danielsymfunobjects are like function handles. - horchler