Continue to Site

# Need program in Matlab which produces a 4*4 matrix that shows digits

Status
Not open for further replies.

#### sarah_spike

##### Newbie level 6
who can write a program in matlab,that can produce a matrix(4*4) ,that show us the digits.for example for digit 1 ,produce that matrix, the first column of it all arrays are 1 and other arrays are 0.and for other digits act in this way....

Re: program in matlab

for the digit you refer given in the variabe (x)

%************************************
A=zeos(4,4);
A,x)=x*ones(4,1);
%************************************

The above code will produce a matrix (A) has zero elements except for the column number (x). All elements of the column number (x) will equal (x).

If this differs from what you need reply and explain what do you need exactly
Roshdy

program in matlab

the first line must be :

A=zeros(4,4);

Re: program in matlab

sorry
it is only typo
the first line of the code is zeros(4,4) not zeos(4,4)
Roshdy

Status
Not open for further replies.