does anybody know the matlab program?
isn't it a programming language that is very math oriented?
yeah
i dont really know how to use it but my father hired a landscaper that uses it to calculate grades and stuff
btw i mean hill grades not school grades and he was teaching my brother how to use it
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
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
and this is wut the program give me m = 5.5511e-017
ergh i dont have matlab on my macbook pro you have to get it on my brothers computer
well idk my brothers not home right now so i cant help, but maybe you should ask in the computer science section too.
oh i didnt know they have it XD
well thats ok, im sure those guys can help cause i am crap at programming
same :S
:( well go to the computer section then cause i dont think anyone here knows matlab
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...
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
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
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.
so just take it off and leave it alone?
don't go a*a2' do: m=((v2*p1')/(p1*p1'))*p1*((((v2*p1')/(p1*p1'))*p1)-2)'
Leave operations implied. Don't calcluate a and a2, leave the operations that make them up. I think it should work.
i just did ur command rudy and now its giving me this m = -2.6667
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.
Although, it seems v2 is the only thing left to replace...
Actually, also replace each vector. p1=[1 1 1], p2=[1 1 0], etc.
Gotta go right now. I'll try to work on this later.
kk thank u for ur help
Join our real-time social learning platform and learn together with your friends!