Jump to content

matlab code not working

Featured Replies

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 by ashwin1124

Archived

This topic is now archived and is closed to further replies.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.