matrix - Access to submatrices in symbolic writing (matlab) -
considering matrix defining using symbolic toolbox
:
syms x y f(x,y)=[1 x x^2; 1 y y^2];
we obtain:
>> f(x,y) ans = [ 1, x, x^2] [ 1, y, y^2]
how can extract second row of matrix? indexing scheme different in case (f(x,y)(2,:)
)?
you have defined (scalar 1x1) symfun returning matrix, there no indexing directly on symfun. extrat symbolic term first:
%convert symfun sym f=f(x,y) %now can use indices f=f(1:2,3) %convert symfun f(x,y)=f
Comments
Post a Comment