Question: Okay so this question is really confusing and I am not even sure where I am supposed to start. Anything will help and thanks in

Okay so this question is really confusing and I am not even sure where I am supposed to start. Anything will help and thanks in advance for at least trying it out.

Write a MATLAB function named mag_force

Inputs: (No input validation is required)

a scalar value representing charge

a 1x3 vector representing velocity

a 1x3 vector representing a magnetic field.

a 1x3 unit vector representing an axis.

Output:

a scalar value calculated by taking the the charge times the cross product of velocity and magnetic field and then taking the dot product of that result with the unit vector of the axis F=q(v x B) Force = F u

Example:

clc; format compact; mag_force(6,[1 2 3],[-2 0 1],[1 0 0]) 

Should display this in the command window

ans = 12 

Your code should work for any set of inputs. Do not include test cases, clear all, etc as part of your submission.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!