How to apply a matrix to a function?
Show older comments
Hello all,
I already uploaded a similar question, but I had not got any answer, so I would like to ask again. I am tyring to apply a matrix to a function, however it gives an error. Following is an example that I am trying to do. Due to convenience, I just use 5 variables in this example.
syms 'T' [1 5]
f = sym(zeros(5, 5));
f(:,:) = T1 + T2 + T3 + T4 + T5;
x_vars = 1:5;
f_ftn (T1, T2, T3, T4, T5) = f;
values = f_ftn(x_vars);
If I run this code, I got an error "Symbolic function expected 5 input arguments but received 1."
I guess Matlab consider x_vars as one input, though it has 5 values in it. Is there any way I can apply the x_vars to f_ftn?
Thank you in advance!
Accepted Answer
More Answers (0)
Categories
Find more on Number Theory 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!