Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Formal SQL Tuning For Oracle Databases Practical Efficiency Efficient Practice

Authors: Leonid Nossov ,Hanno Ernst ,Victor Chupis

1st Edition

3662570564, 978-3662570562

More Books

Students also viewed these Databases questions