Question

In: Mechanical Engineering

Create and complete a function M-file that will receive an input, ? , and output the...

Create and complete a function M-file that will receive an input, ? , and output the corresponding conversion to radians within the range of a complete circle. For each 30? increment, the output should be displayed as a string, (i.e. pi/2 , pi/4 ,etc.), and any other degree to be displayed numerically.

I'm using Matlab, explanations are appreciated.

Solutions

Expert Solution

STEP1:

CREATING A FUNCTION IN MATLAB:

(Code starts below)

function angleradian =rad(Min,Max) %%creating function angle radian in matlab%%
angledegrees=Min:30:Max
angleradian=(angledegrees/180)*sym(pi);%%calculating angle in radian%%

(code ends above)

save above file as rad.m in matlab.

Min & Max are the minimum and maximum value of angle in degrees.

Now in command window type 'rad(a,b)' and click run where a & b should be a real number.

Let us take an example let a=30,b=360.You will get following output:


Related Solutions

IN JAVA!!! In this project, you will use radix.txt as the input file, and output the...
IN JAVA!!! In this project, you will use radix.txt as the input file, and output the integers SORTED USING RADIX SORT. You may assume all your input consists of integers <=9999. Your main program will input the integers and put them into a QUEUE. It will then pass this queue to a method called radixSort which will sort the numbers in the queue, passing the sorted queue back to main. The main program will then call another method to print...
C Programming: Write a program that accepts 2 arguments, an input file and an output file....
C Programming: Write a program that accepts 2 arguments, an input file and an output file. The program is to store in the output file the contents of the input file in reverse. If the input file looks like this: Hello World.\n This is Line 2\n This is the end.\n then the output file should look like this: \n .dne eht si sihT\n 2 eniL si sihT\n .dlroW olleH The main program should look like this: int main(int argc, char...
Create a c++ program with this requirements: Create an input file using notepad ( .txt )...
Create a c++ program with this requirements: Create an input file using notepad ( .txt ) . When testing your program using different input files, you must change the filename inside your program otherwise there will be syntax errors. There are a finite number of lines to be read from the data file. But we can’t assume to know how many before the program executes; so, the standard tactic is to keep reading until you find the “End of File”...
java program: Input and output the following details. Your program can only receive the correct input....
java program: Input and output the following details. Your program can only receive the correct input. (For example: a notification will be given if you not enter Char data type for Name) Name: Ali bin Ahmad Occupation: Technician Age: 30 Hometown: Negeri Sembilan Years of Service: 12 Gender: Male
ASSIGNMENT: Write a program and use the attached file (babynames.txt) as input file, and create two...
ASSIGNMENT: Write a program and use the attached file (babynames.txt) as input file, and create two output tiles. One file listing out all boys names, and the other file listing out all girls name. CODE: (teacher gave some of the code below use it to find the answer please String B is the boy names String E is girl names) import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.util.Scanner; /** This program reads a file with numbers, and writes the numbers...
ASSIGNMENT: Write a program and use the attached file (babynames.txt) as input file, and create two...
ASSIGNMENT: Write a program and use the attached file (babynames.txt) as input file, and create two output tiles. One file listing out all boys names, and the other file listing out all girls name. CODE: (teacher gave some of the code below use it to find the answer please String B is the boy names String E is girl names) import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.util.Scanner; /** This program reads a file with numbers, and writes the numbers...
Write a program that creates a concordance. There will be two ways to create a concordance. The first requires a document to be read from an input file, and the concordance data is written to an output file.
Concepts tested by this program            Hash Table,            Link List,hash code, buckets/chaining,exception handling, read/write files (FileChooser)A concordance lists every word that occurs in a document in alphabetical order, and for each word it gives the line number of every line in the document where the word occurs.Write a program that creates a concordance. There will be two ways to create a concordance. The first requires a document to be read from an input file, and the concordance data is written to...
Write a function that will receive two input arguments that is the height in inches (in.)...
Write a function that will receive two input arguments that is the height in inches (in.) and the weight in pounds (lb) of a person and return two output arguments that is the height in meters (m) and mass in kilograms (kg). Determine in SI units the height and mass of a 5 ft.15 in. person who weight 180 lb. Determine your own height and weight in SI units. Note: 1 meter = 39.3701 inch, 1 foot = 12 inches,...
Create a c++ program that: Create an input file using notepad ( .txt ). When testing...
Create a c++ program that: Create an input file using notepad ( .txt ). When testing your program using different input files, you must change the filename inside your program otherwise there will be syntax errors. There are a finite number of lines to be read from the data file. But we can’t assume to know how many before the program executes; so, the standard tactic is to keep reading until you find the “End of File” marker. Input date...
Objectives To learn to code, compile, and run a program using file input and an output...
Objectives To learn to code, compile, and run a program using file input and an output file. Assignment Plan and code a program utilizing one file for input and one file for output to solve the following problem: Write a program to determine the highest number, the lowest number, their total, and the average of each line of numbers in a file. A file contains 7 numbers per line. How many lines a file contains is unknown. Note Label all...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT