Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

### 1 . Magnitude & Direction of Vector Write a function m - file to find the magnitude and the direction of cosine of vector

### 1. Magnitude & Direction of Vector
Write a function m-file to find the magnitude and the direction of cosine of vector **F** which expresses 3 dimension - $x$, $y$, and $z$. Here are requirements for the function m-file.
- Parameter-list (input(s)):
-3 dimensional vector
- row vector or column vector - undetermined
- Return Value (outputs):
- Magnitude of a given vector - $|\mathbf{\vec{F}}|=\sqrt{F_x^2+F_y^2+F_z^2}$
- Angles(radian) from direction of cosine - $\cos(\alpha)=\frac{F_x}{|\mathbf{\vec{F}}|},\cos(\beta)=\frac{F_y}{|\mathbf{\vec{F}}|},\cos(\gamma)=\frac{F_z}{|\mathbf{\vec{F}}|}$
- Order of outputs : $[Magnitude,\alpha ,\beta ,\gamma ]$
- Function name : ***Mag_Vec_yourEmailAccount***
Using a script m-file which will call the ***Mag_Vec_yourEmailAccount*** function, save outputs with following given inputs.
- If the given vector is $**\mathbf{F}_1=2\hat{i}3\hat{j}6\hat{k}$,** find the outputs of your ***Mag_Vec_yourEmailAccount*** function. Then save the return values on ***EX1_1.dat***.
- If the given vector is $**\mathbf{F}_2=-4\hat{i}2\hat{k}$,** find the outputs of your ***Mag_Vec_yourEmailAccount*** function. Then save the return values on ***EX1_2.dat***.
- If the given vector is $**\mathbf{F}_3=3\hat{i}+4\hat{j}$,** find the outputs of your ***Mag_Vec_yourEmailAccount*** function. Then save the return values on ***EX1_3.dat***.
- If the given vector is $**\mathbf{F}_4=5\hat{j}+12\hat{k}$,** find the outputs of your ***Mag_Vec_yourEmailAccount*** function. Then save the return values on ***EX1_4.dat***.
- If the given vector is $**\mathbf{F}_5=\hat{i}+\hat{j}+\hat{k}$,** find the outputs of your ***Mag_Vec_yourEmailAccount*** function. Then save the return values on ***EX1_5.dat***.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

3. Go over a sample question first.

Answered: 1 week ago