1. Magnitude & Direction of Vector
Write a function m-file to find the magnitude and the directionof cosine of vector F which expresses 3 dimension - x, y, andz.
Here are requirements for the function m-file.
- Parameter-list (input(s)): · 3 dimensional vector · row vectoror column vector
- undetermined - Return Value (outputs):
· Magnitude of a given vector, |F| = ? F2 x + F2 y + F2 z
· Angles(degree) from direction of cosine cos(?) = Fx |F| cos(?)= Fy |F| cos(?) = Fz |F|
· Order of outputs : [Magnitude, ?, ?, ?]
- Function name : ‘Mag_Vec_yourEmailAccount’ Using a scriptm-file which will call the Mag_Vec_yourEmailAccount function, saveoutputs with following given inputs. - F1 = 3ˆi + 2ˆj ? 6ˆk. Saveit on EX1_1.dat.
- F2 = 4ˆi ? 2ˆk. Save it on EX1_2.dat.
- F3 = 4ˆi + 3ˆj. Save it on EX1_3.dat.
- F4 = 5ˆj ? 12ˆk. Save it on EX1_4.dat.
- F5 =ˆi +ˆj + ˆk. Save it on EX1_5.dat.
using mathlab functions, thank you!