Question

A3-2. Modify If.. Structure as used in exercise 3.3.1 by input and disp function. Test

the code by changing the variable 'grade'

A3-3. For a scalar, the built-in MATLAB sign function returns the sign of its

argument (-1, 0, 1). Here's a MATLAB session that illustrates how it works:

sign(25.6)

ans =

1

>> sign(-0.776)

ans =

-1

>> sign(0)

ans =

0

Develop an M-file to perform the same function by using if structure.

Question image 1