Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: correct syntax for matlab..
Replies: 5   Last Post: May 14, 2013 10:11 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
dpb

Posts: 8,187
Registered: 6/7/07
Re: correct syntax for matlab..
Posted: May 11, 2013 8:58 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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


--



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.