Question: Write a Matlab function called Particle using the two variables as input arguments accepts and returns two variables as output arguments. The first input argument

 Write a Matlab function called "Particle" using the two variables as

Write a Matlab function called "Particle" using the two variables as input arguments accepts and returns two variables as output arguments. The first input argument "n" is the Number of particles and second input argument "p" is the coordinates of a specific point in a 3-D coordinate system. The coordinates of all n particles are given as: x = 20 * rand (1, n) y = 30 * rand (1, n) z = 40 * rand (1, n) a) Calculate the average of all particle distances to point "p" with the help of a loop. b) Calculate the distance of the closest particles to the point "p". Use the command "Find" for it. (Don't forget that with the help of the "doc find" command you can find the one you need Information about "find".) Let the answers of a) and b) be the output arguments of your function. 12:59

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!