Ask your own question, for FREE!
Mathematics 11 Online
OpenStudy (mew55):

does anybody know the matlab program?

OpenStudy (anonymous):

isn't it a programming language that is very math oriented?

OpenStudy (mew55):

yeah

OpenStudy (anonymous):

i dont really know how to use it but my father hired a landscaper that uses it to calculate grades and stuff

OpenStudy (anonymous):

btw i mean hill grades not school grades and he was teaching my brother how to use it

OpenStudy (mew55):

well here is my problem. i want the program to multiply a vector to give me zero instead it gives me a number with an exponent :S

OpenStudy (mew55):

here r the commands v1=[1 1 1] v2=[1 1 0] v3=[1 0 0] p1=v1 p2=v2 p3=v3 v1t=v1' v2t=v2' v3t=v3' p1t=p1' p2t=p2' p3t=p3' p1=v1 %Projection of v2 on p1 a=((v2*p1')/(p1*p1'))*p1 %Perpendicular vector of p2 a2=v2-a p2=a2 a2t=a2' %See if p1 and p2 equal to 0 m=(a)*(a2') %Projection of v3 on p1 a3=((v3*p1')/(p1*p1'))*p1 %Projection of v3 on p2 a4=((v3*p2')/(p2*p2'))*p2 %Perpendicular vector of p3 a5=v3-a3-a4 %Answers p1=v1 p2=a2 p3=a5

OpenStudy (mew55):

and this is wut the program give me m = 5.5511e-017

OpenStudy (anonymous):

ergh i dont have matlab on my macbook pro you have to get it on my brothers computer

OpenStudy (anonymous):

well idk my brothers not home right now so i cant help, but maybe you should ask in the computer science section too.

OpenStudy (mew55):

oh i didnt know they have it XD

OpenStudy (anonymous):

well thats ok, im sure those guys can help cause i am crap at programming

OpenStudy (mew55):

same :S

OpenStudy (anonymous):

:( well go to the computer section then cause i dont think anyone here knows matlab

OpenStudy (anonymous):

I just uploaded your code into matlab and I got: v1=[1, 1, 1] v2=[1/3, 1/3, -2/3] v3=[1/2, -1/2,0] Where are you getting the error? The non-zero value? Are you by chance using "octave" instead of matlab? octave is a matlab clone that I've had issues with rounding. It would give me some values like you mention. Finally I just gave up and moved to actual matlab...

OpenStudy (mew55):

i am using matlab. idk y its giving me a number w/ an exponent. and yes i got the same answer for v1,v2 and v3

OpenStudy (mew55):

the part ia m getting an error is the %See if p1 and p2 equal to 0 m=(a)*(a2') i want the output to be 0. not this XD m = 5.5511e-017

OpenStudy (anonymous):

Okay I see it. When it calculates m=a*a2' The problem is, it's rounding some stuff. I would leave as many operations implied as possible.

OpenStudy (mew55):

so just take it off and leave it alone?

OpenStudy (anonymous):

don't go a*a2' do: m=((v2*p1')/(p1*p1'))*p1*((((v2*p1')/(p1*p1'))*p1)-2)'

OpenStudy (anonymous):

Leave operations implied. Don't calcluate a and a2, leave the operations that make them up. I think it should work.

OpenStudy (mew55):

i just did ur command rudy and now its giving me this m = -2.6667

OpenStudy (anonymous):

I messed up on some parenthesis. Because I just did: (((v2*p1')/(p1*p1'))*p1)*([1 1 0]-((v2*p1')/(p1*p1'))*p1)' and got the same rounding off value: 5.5511e-017 Still, I would leave even more operations implied. Don't calculate anything if possible. Just leave it all implied.

OpenStudy (anonymous):

Although, it seems v2 is the only thing left to replace...

OpenStudy (anonymous):

Actually, also replace each vector. p1=[1 1 1], p2=[1 1 0], etc.

OpenStudy (anonymous):

Gotta go right now. I'll try to work on this later.

OpenStudy (mew55):

kk thank u for ur help

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!