Matrix creation for n natural numbers

Home Forums Matlab Matrix creation for n natural numbers

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  cK 10 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #487

    samuelsuhas1991
    Participant

    Dear Sir,
    Kindly have a look at the picture. My doubt is that, is here any shortcut way of generating the same matrix without using 11:20 . . . . . . 91:100.

    Regards,
    Samuel.

    Attachments:
    You must be logged in to view attached files.
    #489

    cK
    Keymaster

    For the numbers you have to either generate them or import them. Then they can be reorganised to an arbitrary shape. For this case,

    x = 1:100;
    m = reshape(x,10,10);
    m = m';

    Or, without creating intermediate variables just reshape(1:100,10,10)'

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.