Question: This program is in matlab if you cant view images, right click it and click display in new tab ES 201 Spring 2017- Week 10
This program is in matlab


if you cant view images, right click it and click display in new tab
ES 201 Spring 2017- Week 10 Homework Due: 9:30 am Tuesday 04/04/2017 Learning objectives 10 Write a function that accepts variable number of arguments 10 Write a function that returns multiple arguments Use nargin statement 10 Use switch statements Use nested for loop Use sprintf Cor fprintf) for formatted output to the screen Create an array and rearrange it 10 10 Use isnan Instructions You will have two problems to solve for this week. Question 1 Instructions The Cartesian and Spherical coordinates can be converted to each other using the following equations: 0 arccos arccos arctan Source Create a function named spherical coordinate. m to convert the Cartesian coordinate to Spherical coordinate system that gets three input parameters. Then use nargin statement to identify the number of inout parameters entered by the user. Using switch statement, set the value of y30 and z 0 if only the value of x is entered. If the value of x and y are entered and value of z is missing, set z 0. Then use the above mentioned conversions to convert the coordinates system and display the result with 2 decimals Sample output: spherical coordinate (2, 10) spherical coordinate (2) r: 10.20 r 2.00 theta: 1.5 theta 57 phi: 1.37 phi 0.00
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
