Operator matrix for matrix differentiation
4 views (last 30 days)
Show older comments
Is there a way to define an operator matrix, such that:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/147132/image.gif)
1 Comment
Jan
on 26 Apr 2012
Please define the inputs and outputs explicitly. Do you want numerical or symbolical operations?
Accepted Answer
Andrei Bobrov
on 26 Apr 2012
symbolic
function dNdv = diffmtx(v,N)
% v -vector m x 1 - sym array
% N - matrix m x n - sym array
rz = arrayfun(@(ii)diff(N(ii,:),v(ii)),(1:numel(v)).','un',0);
dNdv = cat(1,rz{:});
end
1 Comment
Jan
on 26 Apr 2012
What about: dNdv = [diff(N(1, :), v(1)), diff(N(2, :), v(1)); diff(N(3, :), v(2)), diff(N(4, :), v(2))] ?
More Answers (1)
See Also
Categories
Find more on Symbolic Math Toolbox 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!