how to pick a colum vector from a matrix

Discussion in 'MATLAB' started by marc valente, Dec 8, 2006.

  1. marc valente

    marc valente Guest

    I was just woundering if it is posible to pick out a colum vector
    from a matirx. That is if I just wanted the jth colum in an nxn
    matrix is there a way to assing it to a variable?
    marc valente, Dec 8, 2006
    1. Advertisements

  2. marc valente

    mamdouh Guest

    Please see the following example it it helps

    A=[1 2 3; 4 5 6; 7 8 9];

    mamdouh, Dec 8, 2006
    1. Advertisements

  3. additionally, if you want just rows you could say (r,:) where r is
    the row you desire. if you want several rows or columns (a submatrix)
    try (1:3,:) which would be the first three rows or :),2:5) which
    would be columns 2-5. good luck
    bahhhhhhhhhhh, Dec 8, 2006
  4. marc valente

    us Guest

    marc valente:
    <SNIP cotton-picking - column-picking...

    one of the many solutions

    % the matrix
    % the picking index/indices
    % the col submat
    % the row submat

    us, Dec 8, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.