Date: May 11, 2013 8:58 AM
Author: dpb
Subject: Re: correct syntax for matlab..

On 5/11/2013 3:35 AM, virat rehani wrote:
> How can I write this code in matlab?
>
> int counter=0;
> int ar2[10][2];
> for(int i=0;i<9;i++)
> for(int j=0;j<4;j++)
> if(ar[i][j]==1)
> row=I;
> col=j;
> ar2[counter][0]=row;
> ar2[counter][1]=col;
> counter=counter+1;
> end
> end
>end


[ar2(:,1) ar2(:,2)]=find(ar);

doc find


--