syms f (x,y) Assign a mathematical expression to f. Creating f automatically creates x and y. Create a symbolic function f with variables x and y by using syms. In reality I am trying to write a function that will create a polynomial of specified degree and save it to the path so I could use 'eval' with it (which doesn't support polyval), but it will probably be useful for more. The Symbolic Math Toolbox currently does not support composite symbolic functions, or symbolic functions that are functions of another symbolic functions.The problem is that the code seen above creates a function with the set of input arguments (x1, x2, a1, a2) instead of (x,a) and I can't change the form of input arguments, it must be uniform.It is said in the document that creating vectors by x sym('x',50 1) and use it for generate objective function f(x), but it doesn't work if I want to test the value of function when x ones(50,1) since the input expects 50 variables. % handle=matlabFunction(f(x,a),'file','test1') I'm new to Matlab and I wonder how to input a vector to a symbolic function. It can be evaluated, used in any other M-file, or differentiated/integrated in the Symbolic Math Toolbox (see Section 8). *After creating the symbolic variables and all I use 'matlabFunction' to create and save the function. I have been having trouble creating a symbolic vector (not a vector of symbolic variables).ĭo you guys know a way to do this without creating and editing a text-like matlab function file in your path? I am trying to create a function using the symbolic toolbox in matlab.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |