Is it possible to use 'solve' on a vector of functions?
조회 수: 3 (최근 30일)
이전 댓글 표시
Is it possible to use 'solve' function on a column/row vector of functions where each row/column is a function of just one variable?
syms t
funcVec = [3*t+2; 5t-3]
solve(funcVec)
For example, running the above lines of code should give me a vector
[-2/3; 3/5].
댓글 수: 0
답변 (1개)
Walter Roberson
2012년 11월 7일
No.
You can use
arrayfun(@solve, funcVec)
Or you can use the symbolic map() function. Note that map() is not exposed at the MATLAB level, so you would need evalin() or feval()
댓글 수: 8
Walter Roberson
2012년 11월 8일
Yup. You would probably get better speed by evalin(symengine, ...) or feval(symengine, ...) some code that did the work for you all at the MuPAD level, such as by using MuPAD's map() . At the very least that would remove the overhead of talking to the symbolic engine for each operation.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!