subs function handle not working with arrayfun
이전 댓글 표시
subbed_cell_out = arrayfun(@subs,sym_fun_cell,'uniformoutput',false); % No change to sym_fun_cell
I have a cell array of matrices containing symbolic functions (ie. sym_fun_cell).
The symbolic functions themselves are functions of 'x' and 'x_r'. So I want to sub for x_r and x which already have values assigned within the workspace.
An example of an element of sym_fun_cell is:
[ 0.05*(13.0*x^3 - 10.0*x^2 + 1.0)^2, 0.05*(3.4*x^3 - 3.7*x^2 + x)*(13.0*x^3 - 10.0*x^2 + 1.0), 0.05*(- 13.0*x^3 + 10.0*x^2)*(13.0*x^3 - 10.0*x^2 + 1.0), -0.05*(- 3.4*x^3 + 1.9*x^2)*(13.0*x^3 - 10.0*x^2 + 1.0)]
[ 0.05*(3.4*x^3 - 3.7*x^2 + x)*(13.0*x^3 - 10.0*x^2 + 1.0), 0.05*(3.4*x^3 - 3.7*x^2 + x)^2, 0.05*(- 13.0*x^3 + 10.0*x^2)*(3.4*x^3 - 3.7*x^2 + x), -0.05*(- 3.4*x^3 + 1.9*x^2)*(3.4*x^3 - 3.7*x^2 + x)]
[ 0.05*(- 13.0*x^3 + 10.0*x^2)*(13.0*x^3 - 10.0*x^2 + 1.0), 0.05*(- 13.0*x^3 + 10.0*x^2)*(3.4*x^3 - 3.7*x^2 + x), 0.05*(- 13.0*x^3 + 10.0*x^2)^2, -0.05*(- 13.0*x^3 + 10.0*x^2)*(- 3.4*x^3 + 1.9*x^2)]
[ -0.05*(- 3.4*x^3 + 1.9*x^2)*(13.0*x^3 - 10.0*x^2 + 1.0), -0.05*(- 3.4*x^3 + 1.9*x^2)*(3.4*x^3 - 3.7*x^2 + x), -0.05*(- 13.0*x^3 + 10.0*x^2)*(- 3.4*x^3 + 1.9*x^2), 0.05*(- 3.4*x^3 + 1.9*x^2)^2]
Thanks
댓글 수: 1
Walter Roberson
2017년 3월 1일
That code seems to be appropriate to me. I works when I test with it.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Number Theory에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!