Placeholder symbol from single value to vector?
Show older comments
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!
Answers (1)
Walter Roberson
on 14 Nov 2012
0 votes
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)
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!