- #1
quetzal
- 6
- 0
Homework Statement
I have a matrix that contains zeros but it may contain also ones. For example:
Code:
ID=[1 0 0 0;
0 0 0 0;
1 0 1 1]
Code:
EA=1:8; ID=[0 2 5 7;
1 3 6 8;
0 4 0 0]
Homework Equations
The Attempt at a Solution
I tried it this way but don't know how to finish it:
Code:
D=3;
N=4;
ID=zeros(D,N);
equations=sum(ID(:)==0);% number of zeros in matrix ID
EA=1:equations;
for j=1:N
for i=1:D
if ID(i,j)==1
ID(i,j)=0;
else
ID(i,j)=?;
end
end
end
Last edited: