I need to build up a vector of non-linear equations to be used in fsolve
to solve it. But I should make each element of the vector in each loop iteration. How can I make up such a vector? In fact, I can not use cell array. How can I convert a cell array like {@(x) x(1)+x(2)^2; @(x) x(1)-2*(x(2))}
into an array like @(x) [ x(1)+x(2)^2 ; x(1)-2*(x(2))]
? Because I want to use fsolve
to solve the system of non-linear equations.
相关问题
- Extract matrix elements using a vector of column i
- How do you get R's null and residual deviance
- How to display an image represented by three matri
- OpenCV - Is there an implementation of marker base
- Avoid copying an array when using mexCallMATLAB
相关文章
- How do I append metadata to an image in Matlab?
- How can I write-protect the Matlab language?
- `std::sin` is wrong in the last bit
- Escape sequence to display apostrophe in MATLAB
- Vertical line fit using polyfit
- Reading .mat file using C: how to read cell-struct
- Is it possible to compare 3D images?
- How can I find row to all rows distance matrix bet
Use
func2str
to get the function definitions in string and usestr2func
to get the desired function, ifA
is the cell array containing the function handles:Now
F
contains the desired function handle.Why convert? Why not use something like