Results 1 to 5 of 5

Math Help - MATLAB: The cat command

  1. #1
    Junior Member
    Joined
    Oct 2008
    Posts
    49

    MATLAB: The cat command

    Hi guys

    Say I have two 2x2 matrices A and B. If I use the command

    Code:
    c=cat(3,a,b)
    then c(:,:,1) is A and c(:,:,2) is B. Now, if I use c=cat(2,a,b) I get a rowe, and if I use c=cat(1,a,b) I get a 2x2 matrix. What is the logic behind the last two commands?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Google "help matlab cat"

    CB
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Junior Member
    Joined
    Oct 2008
    Posts
    49
    Quote Originally Posted by CaptainBlack View Post
    Google "help matlab cat"

    CB
    I found http://www.mathhelpforum.com/math-he...t-command.html, but why does it add the matrices vertically when using the first dimension and horizontally with the second dimension? They do now explain that.

    Is it just a convention?
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by Niles_M View Post
    I found http://www.mathhelpforum.com/math-he...t-command.html, but why does it add the matrices vertically when using the first dimension and horizontally with the second dimension? They do now explain that.

    Is it just a convention?
    It is not a convention, the first argument defines the sense of the concatenation (as per the help files)


    CB
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Junior Member
    Joined
    Oct 2008
    Posts
    49
    Quote Originally Posted by CaptainBlack View Post
    It is not a convention, the first argument defines the sense of the concatenation (as per the help files)


    CB
    I get it, thanks!
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. [SOLVED] Left hand alignment in the matrix command and array command
    Posted in the LaTeX Help Forum
    Replies: 8
    Last Post: May 3rd 2011, 03:31 PM
  2. Replies: 2
    Last Post: February 19th 2011, 06:54 AM
  3. Matlab command window small
    Posted in the Math Software Forum
    Replies: 0
    Last Post: March 25th 2010, 03:29 AM
  4. MATLAB Command Window cursor
    Posted in the Math Software Forum
    Replies: 3
    Last Post: January 29th 2010, 11:53 PM
  5. command for..?
    Posted in the LaTeX Help Forum
    Replies: 9
    Last Post: November 2nd 2007, 06:40 AM

Search Tags


/mathhelpforum @mathhelpforum