Placeholder symbol from single value to vector?

Hello,
I need to take a general function of two unknowns, 'a' and 'p', convert it to a polynomial expression in 'a' and then take a Chebyshev polynomial decomposition in 'p'.
So far, I have set up 'p' as a symbol, I discretize the function in 'a', and use 'polyfit' to find coefficients (dependent on 'p'). But then I want to change 'p' to a vector and I am getting the error that the 'subs' command will only work with 'old' and 'new' of the same length.
Does anyone know how to work around this in Matlab?
Thanks!

Respuestas (1)

Walter Roberson
Walter Roberson el 14 de Nov. de 2012

0 votos

What is the next step? If the further steps can be done numerically, then use matlabFunction() to convert the symbolic form to a function handle; you can pass vectors in as the arguments to the function so formed (operations will be element-by-element)

Categorías

Más información sobre Symbolic Math Toolbox en Centro de ayuda y File Exchange.

Preguntada:

ACE
el 13 de Nov. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by