From: antonio ferreira on 21 Jul 2010 12:01 Hi all. I am having some difficulties to associate the values in a matrix.I have a simple matrix C=[ 1 2; 3 4;6 7] and two variables: x=3 and y. My objective is to see all values in the first column and when the number 3 is achieved variable y must be equal to 4.I have created a simple routine but i am not being able to "finish it". Any suggestions would be very helpful: x=3; for m=1:size(C,1) for n=1:size(C,1) if C(:,1)==x y=%here are my problems i think end end end regards
From: Andy on 21 Jul 2010 12:11 C=[ 1 2; 3 4;6 7]; x=3; y=C(C(:,1)==x,2);
From: antonio ferreira on 21 Jul 2010 12:22 Much more easier.Thanks a lot.Regards "Andy " <myfakeemailaddress(a)gmail.com> wrote in message <i2766p$5fr$1(a)fred.mathworks.com>... > C=[ 1 2; 3 4;6 7]; > x=3; > y=C(C(:,1)==x,2);
|
Pages: 1 Prev: 2D deconvulution with complex values Next: how to create geoTiff? |