help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: extracting rows in a matrix


From: John W. Eaton
Subject: Re: extracting rows in a matrix
Date: Wed, 13 May 2009 09:27:00 -0400

On 13-May-2009, Carlo Rossi wrote:

| this is very cool but actually I need to write something that is good
| for Matlab too; and I notice only now that it doens't work in Matlab

| B = A(randperm (size (A, 1)), :)(1:size (A, 1)/5, :);

Then write it like this:

  tmp = A(randperm (size (A, 1)), :);
  B = tmp(1:size (A, 1)/5, :);

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]