double - symbolic expression to numeric in matlab -


i need calculation on symbolic toolbox.

i have value is:

q = sym('q%d', [n 1]); n not fixed value (it defined user)

i need calculations on such as:

for i=1:n     z(:,i+1) = t_a(1:3,1:3)*z(:,1); end 

where (for n=2 value of t_a changing different n values)

t_a=[ cos(q1), -(4967757600021511*sin(q1))/81129638414606681695789005144064,                                          -sin(q1),    0;  sin(q1),  (4967757600021511*cos(q1))/81129638414606681695789005144064,                                           cos(q1),    0;        0,                                                           -1, 4967757600021511/81129638414606681695789005144064, 1/10        0,                                                            0,                                                 0,    1] 

and

z =       0     0     0      0     0     0      1     0     0 

when run code gives error , says:

the following error occurred converting sym double: double cannot convert input expression double array. if input expression contains symbolic variable, use vpa. 

baed on other question, tried use double command q=double(q)but didn't work.

how can solve problem.

thanks in advance


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -