[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Matrix resizing
From: |
Thomas Shores |
Subject: |
Re: Matrix resizing |
Date: |
Sat, 06 Mar 2010 10:56:33 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Thunderbird/3.0.3 |
Make that
a = rand(10);
b = a(1:2:rows(a),:);
c = b(vec(repmat(1:rows(b),2,1)),:)
and similarly for columns
a = rand(10);
b = a(:,1:2:columns(a));
c = b(:,vec(repmat(1:columns(b),2,1)),:)
On 03/06/2010 10:18 AM, Martin Helm wrote:
Am Samstag, 6. März 2010 16:31:45 schrieb Marius Roets:
Hi,
Is there a vectorized way to delete every other row/column in a matrix?
Similarly to duplicate every other row/column?
Thanks
Marius
Something like that?
a = rand(10);
b = a(1:2:rows(a), :)
_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave