Write a function that takes two square matrices of the same size and an operator name as inputs and apply the operator o

  1. Function, switch statement. Write a function that takes two square matrices of the same size and an operator name as inputs and apply the operator on the two matrices. The operator name can be ‘+’, ‘-‘, ‘*’, and ‘/’. For example, when the function opName input is '+', the function calculates A+B; when the function opName input is '-', the function calculates A-B.

Function C = ApplyOp(A, B, opName)

Switch opName

Case ‘+’

C=…;

In your main script, create the following matrices and call your function with all operators.

A=421 B = 340

020 715

109 095

(2) Function. You work for an engineering design firm that has been contracted to evaluate the concentration of pollutants. A tall chimney releases (20 kg/s) of smoke into a steady uniform wind of speed (u( m/s)). An expression for the decay of the peak pollutant concentration C(ppm) with distance downwind is given as:

C(x,y,z)= M / 4πρDx * e^−((y^2+z^2)u / 4Dx)

Assuming that the diffusion coefficient D to be 0.01 m2/s, and the density of air to be

ρ=1.225 kg/m^3

  • Write a function which gets the location(x,y,z) and the wind speed, u, as inputs and calculates the pollutant concentration.
  • Call your function to find how pollution concentration at location (x=3000, y=0, z=10) changes with wind speed 0<u<12 m/s. Plot the pollution concentration vs wind speed.
  • question (3) Loops and flow control. Make function called loopTest(N) that loops through the values 1 through N and for each number n it should display ‘n is divisible by 2’, ‘n is divisible by 3’, ‘n is divisible by 2 AND 3’ or ‘n is NOT divisible by 2 or 3’. Use a for loop, the function mod or rem to figure out if a number is divisible by 2 or 3, and num2str to convert each number to a string for displaying. You can use any combination of if, else, and elseif.

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more