Question: Main topics: Function and Plotting Review Open MATLAB Create a Function file named Lab09 Right click Current Folder title of that window Select New File

Main topics: Function and Plotting Review

Open MATLAB

Create a Function file named Lab09

Right click Current Folder title of that window

Select New File by moving mouse to that option

Click on Function in the pop-up menu

Type Lab09 in the highlight field and hit the enter key

Double click the Lab09.m entry (that you just created) in the Current Folder window

Modify the Function file so that it:

Computes the roots of a quadratic function fx=ax2+bx+c, where a0.

To compute these roots, use the quadratic formula:

x= (-bb2-4ac2a) ^(0.5)

Think carefully about the function you have to write:

How many inputs should the function have?

How many outputs?

What should your function do if a=0?

What if a=0 and b=0?

Test your function by calling it with different values. You can write a script for this, or use the Command Window.

For one of your function calls, plot a graph of the quadratic in the appropriate x- and y-axis viewing window to confirm the results of your function. Again, you can write a script for this, or use the Command Window.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!