This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Unit 10 Readiness Test D Note: All Programs have to be submitted as mfiles 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. value in each row and column of the matrix and print the position in the matrix as well....
View
Full
Document
This note was uploaded on 03/19/2008 for the course ME 205 taught by Professor Koen during the Spring '07 term at University of Texas at Austin.
 Spring '07
 Koen

Click to edit the document details