The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How to create a rectangular checker box matrix
Replies: 1   Last Post: Jul 28, 2013 5:37 PM

Advanced Search

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

Posts: 12
Registered: 10/30/12
How to create a rectangular checker box matrix
Posted: Jul 28, 2013 3:17 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I need to create M as follows

M=[1 0 1 0;0 1 0 1;1 0 1 0 ]

where m=size(M,1);n=size(M,2)

My code should take m,n as input and its output should be M

Code 1:

Code 2:
colvector=[1 0 1 ]
rowvector=[1 0 1 0]

The problem with Code2 is that I don't know how to create colvector and rowvector
in the first place

I have read the following thread and it talks about generating square matrices of such nature but I dont want to restrict M to be a square matrix

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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.