Prev: A question about usage of "from workspace" block in Matlab.
Next: Optimal Fit of a Non-linear Function.....parameter output?
From: Ulrik Nash on 15 Jul 2010 06:47 Hi Everyone, I it possible to reduce the following to a single line? A = max([firm_profit(:,t),firm_price(:,t)]) B = A(1,1) Kind regards, Ulrik.
From: us on 15 Jul 2010 06:56 "Ulrik Nash" <uwn(a)sam.sdu.dk> wrote in message <i1mov9$m1f$1(a)fred.mathworks.com>... > Hi Everyone, > > I it possible to reduce the following to a single line? > > A = max([firm_profit(:,t),firm_price(:,t)]) > B = A(1,1) > > Kind regards, > > Ulrik. yes, of course... A=max([firm_profit(:,t),firm_price(:,t)]);B=A(1,1); us
From: Ulrik Nash on 15 Jul 2010 07:02 "us " <us(a)neurol.unizh.ch> wrote in message <i1mpg4$p36$1(a)fred.mathworks.com>... > "Ulrik Nash" <uwn(a)sam.sdu.dk> wrote in message <i1mov9$m1f$1(a)fred.mathworks.com>... > > Hi Everyone, > > > > I it possible to reduce the following to a single line? > > > > A = max([firm_profit(:,t),firm_price(:,t)]) > > B = A(1,1) > > > > Kind regards, > > > > Ulrik. > > yes, of course... > > A=max([firm_profit(:,t),firm_price(:,t)]);B=A(1,1); > > us That is neat! Thanks us! :-)
From: Ulrik Nash on 15 Jul 2010 07:09 "Ulrik Nash" <uwn(a)sam.sdu.dk> wrote in message <i1mprd$hqs$1(a)fred.mathworks.com>... > "us " <us(a)neurol.unizh.ch> wrote in message <i1mpg4$p36$1(a)fred.mathworks.com>... > > "Ulrik Nash" <uwn(a)sam.sdu.dk> wrote in message <i1mov9$m1f$1(a)fred.mathworks.com>... > > > Hi Everyone, > > > > > > I it possible to reduce the following to a single line? > > > > > > A = max([firm_profit(:,t),firm_price(:,t)]) > > > B = A(1,1) > > > > > > Kind regards, > > > > > > Ulrik. > > > > yes, of course... > > > > A=max([firm_profit(:,t),firm_price(:,t)]);B=A(1,1); > > > > us > > That is neat! Thanks us! :-) Maybe I was a little fast there. Is it not possible to achieve the result with only one equation?
From: us on 15 Jul 2010 07:20
"Ulrik Nash" <uwn(a)sam.sdu.dk> wrote in message <i1mq8h$e13$1(a)fred.mathworks.com>... > "Ulrik Nash" <uwn(a)sam.sdu.dk> wrote in message <i1mprd$hqs$1(a)fred.mathworks.com>... > > "us " <us(a)neurol.unizh.ch> wrote in message <i1mpg4$p36$1(a)fred.mathworks.com>... > > > "Ulrik Nash" <uwn(a)sam.sdu.dk> wrote in message <i1mov9$m1f$1(a)fred.mathworks.com>... > > > > Hi Everyone, > > > > > > > > I it possible to reduce the following to a single line? > > > > > > > > A = max([firm_profit(:,t),firm_price(:,t)]) > > > > B = A(1,1) > > > > > > > > Kind regards, > > > > > > > > Ulrik. > > > > > > yes, of course... > > > > > > A=max([firm_profit(:,t),firm_price(:,t)]);B=A(1,1); > > > > > > us > > > > That is neat! Thanks us! :-) > > > Maybe I was a little fast there. Is it not possible to achieve the result with only one equation? well... the first reply was a ...JOKE..., of course... one of the solutions [a,b]=deal(max(-1:2)) % a = 2 % b = 2 us |