Ask your own question, for FREE!
Mathematics 9 Online
OpenStudy (raffle_snaffle):

Matlab question subtracting vectors.

OpenStudy (raffle_snaffle):

@mathmate

OpenStudy (raffle_snaffle):

How do I subtract m*aG and g, those are both vectors.

OpenStudy (sooobored):

type aG instead of ag

OpenStudy (raffle_snaffle):

It says array size must match. I think aG needs to be transposed?

OpenStudy (sooobored):

no no, you put the wrong variable in "ag" is undefined

OpenStudy (sooobored):

its suppose to be aG not ag it makes a huge difference

OpenStudy (raffle_snaffle):

aG is a vector. It's the double cross product.

OpenStudy (raffle_snaffle):

I changed it to aG

OpenStudy (sooobored):

B scalar?

OpenStudy (raffle_snaffle):

Yes

OpenStudy (raffle_snaffle):

B = beta = angle

OpenStudy (sooobored):

FRA= ... should work then since they're both 3x1

OpenStudy (raffle_snaffle):

Array sizes must match. Error in sym/privBinaryOp (line 946) Csym = mupadmex(op,args{1}.s, args{2}.s, varargin{:}); Error in - (line 7) X = privBinaryOp(A, B, 'symobj::zip', '_subtract');

OpenStudy (sooobored):

er... since you're dealing with symbolic math, are you sure you can use the cross function?

OpenStudy (raffle_snaffle):

Yes, I've seen my friend do it and I was able to find HG and dHG just fine.

OpenStudy (sooobored):

dont know what else to say, other than use the debug function in order to determine the exact point your code is failing since it doesnt seem obvious

OpenStudy (raffle_snaffle):

This looks good to you though? g = [(m*g*cos(B)); -(m*g*sin(B)); 0]; FRA = m*aG - g; FRA = minus(m*aG - g)

OpenStudy (raffle_snaffle):

I found the error!

OpenStudy (sooobored):

mind sharing?

OpenStudy (raffle_snaffle):

Suppose to be FRA = minus(m*aG , g), not m*aG - g

OpenStudy (sooobored):

ah ok would not have figured that out from here without matlab

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!