From: paul doherty on 12 Jul 2010 10:34 Cheers for your replies, spot on. On Jul 12, 2:59 pm, "someone" <some...(a)somewhere.net> wrote: > "Paul doherty" <doher...(a)gmail.com> wrote in message <i1f65c$ap...(a)fred.mathworks.com>... > > I'm pretty new to MATLAB coding. I have a matrix with multiple rows (the number varies) and 3 columns. That looks something like the following: > > 1 2 5 > > 1.3 4 1 > > 1.4 2 2 > > 1.5 3 3 > > > I'm sure this is really simple, but how do I reduce the matrix down. Specifically the first column contains increasing numbers. Depending on the application, I will want the matrix to contain numbers that will be below a specific number X (eg. 1.4). So I want to reduce the matrix down to: > > > 1 2 5 > > 1.3 4 1 > > > However the number X changes for different applications and the matrix is massive. Any help greatly appreciated? > > % One solution: > > x = [1 2 5;1.3 4 1;1.4 2 2;1.5 3 3]; > X = 1.35; > y = x(x(:,1)<X,:) > y = > > 1.0000 2.0000 5.0000 > 1.3000 4.0000 1.0000
First
|
Prev
|
Pages: 1 2 Prev: Using OpenMP with cpp Next: How to save a Affymetrix cel file in matlab? |