{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Unit Test 10D - Unit 10 Readiness Test D Note All Programs...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Unit 10 Readiness Test D Note: All Programs have to be submitted as m-files pasted in a word doc or text file 1. Create a function that has three inputs  x y  and  o . Based on the value of  o  determine the  o th  root and the  o th  power of  x  and  y . Hint :   You cannot compute the square root for a negative number. You can use the  example on page 377 of the book (Engg. Prog. C, MATLAB, JAVA) as a model.) X = input( 'Input the value of X: ' ); Y = input( 'Input the value of Y: ' ); o = input( 'Input the value of o: ' ); othRoot = 1/o; fprintf( 'The oth root of X is: ' ); rootX = X^othRoot fprintf( 'The oth root of Y is: ' ); rootY = Y^othRoot fprintf( 'The oth power of X is: ' ); powerX = X^o fprintf( 'The oth power of Y is: ' ); powerY = Y^o 2. Create a  n x m  matrix with  n  and  m  being inputs. Output the maximum matrix element  value in each row and column of the matrix and print the position in the matrix as well. 
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}