ashwin1124 Posted May 15, 2012 Posted May 15, 2012 (edited) Hi there cn anyone help me with my work...i'll put the question... the digit 0 to 9 be associated with the alphabets A to J as follows 0-j1-h2-a3-c4-e5-g6-i7-f8-b9-d write a matlab program that prompts the user to input a seven digit telephonenumber and then displays a list of all letters that can be formed from thenumber.for example 7848979 begins :fbebdfd, fbebddf, fbebfddsupport your work with a flow chart xfunction alpha %First we define a matrix a for the lettersa = ['JHACEGIFBD']; %Input 7 digit telephone number using 'input' function and store in matrix e for n = 1:7, b = input('\nPlease enter a 7 digit number (after each number press enter): '); e(n) = b; end %Match each number of tel no. with a letter from matrix a and store in matrix m for n = 1:7, h = e(n); m(n) = a(h); end %Use perms function to permutate the digits in matrix m p = perms(e)end Edited May 15, 2012 by ashwin1124
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now