Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need to do the following using MATLAB. 1. Write a script m-file, which asks from a client the name, the current status at the university,

Need to do the following using MATLAB.

1. Write a script m-file, which asks from a client the name, the current status at the university, and the year when client will graduate. Use fprintf function to create the following text:

My name is Firstname Lastname.

I am a student of University name.

I am a Standing.

My major is Major.

I will graduate after number of years year(s).

I am looking for a job in Job.

Words and digits indicated by bold letters should be variables .

2. Write function m-files and use them to solve the following problems:

a) to evaluate the volume of the cylinder with input parameters (the radius of the base and the height) as arguments. If at least one of these input parameters is negative an error message should appear.

b) to create a function: image text in transcribed,

an error message should appear if function is undefined for some values of variables.

c) to create a function y = ( x 2 ? 1 if x 0.)

d) to plot the function created in 2c in interval [?2, 2].

3) Write a function m-file to create a vector in a dialog mode. Use the size of the vector as an argument, and the created vector as an output. Use for ... end loop and input function.

4) Write a function m-file to create a matrix in a dialog mode. Use the size of the matrix as an argument, and the created matrix as an output. Use for ... end loop and input function.

5) Write a function m-file to evaluate the product of the components of the given vector. Use for ... end loop.

6) Write a function m-file to evaluate the number of classes taken by a student. The program should ask a student his name, how many terms he took, and how many classes he/she took each term. Then, the program should calculate the total number of classes taken by the student and print: Student name has taken number of classes classes.

7. Write a function m-file to plot in the same figure graphs of the functions sin(x), cos(x), 2sin(0.5x), and ? cos(2x) in the interval [??, ?], choose different colors and different lines for different functions.

8. Write a function m-file to create a matrix of plots in a single figure window for graphs of the functions x, x 2 , x 3 , and x 4 in the interval [?2, 2]. Use different types of lines.

In(ar + Y 2 + 25) VTY a

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

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions