Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started