How to carry out this multiplication.

1 view (last 30 days)
syms fyi theta x y z
r = 2;
x = r*sin(fyi)*cos(theta);
y = r*sin(fyi)*sin(theta);
z = r*cos(fyi);
a = [x y z]
simplify(subs((x^2)+(y^2)+z^2,[x,y,z],a))
ezsurf(a(1),a(2),a(3),[0,pi,0,2*pi])
surffactor = simple((cross(diff(a,theta),diff(a,fyi))))
here i get the surffactor a symbolic matric of 1*3 . I need to multiply this witha nother matrix of 101*7000 which has constant entities. How should i carry out the multiplication. it shows error
Error in MuPAD command: Dimensions do not match. [(Dom::Matrix(Dom::ExpressionField()))::_mult2]
Error in sym/privBinaryOp (line 1694)
Csym = mupadmex(op,args{1}.s, args{2}.s, varargin{:});
Error in sym/mtimes (line 184)
X = privBinaryOp(A, B, 'symobj::mtimes');
Error in code (line 42)
majorfunction = (func1*surffactor1)

Answers (1)

Walter Roberson
Walter Roberson on 2 Sep 2015
What size of output are you expecting when you multiply your 1 x 3 matrix by a 101*7000 matrix? The dimensions do not agree.
Are you sure it is cross product you want and not dot product? Dot product would give you a scalar rather than a vector.
  2 Comments
Chandramohan Meena
Chandramohan Meena on 2 Sep 2015
I could make my 1*3 symbolic matrix into 1*7000 by padding zeroes, then dimesions will agree but it still isn't working. And yeah it is cross product only.
Walter Roberson
Walter Roberson on 2 Sep 2015
func1(:,1:3) * surffactor1
if you are looking for a 101 x 1 answer. If you are not looking for a 101 x 1 answer then please indicate exactly what size of output you are looking for.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!