From: Kevin on 26 Mar 2010 04:26 Hi guys, I'm very new with MATLAB and need help solving a problem, Lets say I have a vector x = [1,0,2,0,3,0,4,0,5] How can I truncate/get rid of the value 0 so it does not show up? I want it to look like this: [1,2,3,4,5] This is a pretty simple question but I can't find the answer anywhere! Any help would be very appreciated! Thanks.
From: us on 26 Mar 2010 04:36 "Kevin " <x1nner(a)hotmailremovethis.com> wrote in message <hohr2s$3oe$1(a)fred.mathworks.com>... > Hi guys, I'm very new with MATLAB and need help solving a problem, > > Lets say I have a vector x = [1,0,2,0,3,0,4,0,5] > How can I truncate/get rid of the value 0 so it does not show up? > I want it to look like this: [1,2,3,4,5] > > This is a pretty simple question but I can't find the answer anywhere! Any help would be very appreciated! > Thanks. one of the solutions x=[1,0,2,0]; x=x(x~=0) % x = 1 2 us
From: Kevin on 26 Mar 2010 04:44 "us " <us(a)neurol.unizh.ch> wrote in message <hohrli$bvc$1(a)fred.mathworks.com>... > "Kevin " <x1nner(a)hotmailremovethis.com> wrote in message <hohr2s$3oe$1(a)fred.mathworks.com>... > > Hi guys, I'm very new with MATLAB and need help solving a problem, > > > > Lets say I have a vector x = [1,0,2,0,3,0,4,0,5] > > How can I truncate/get rid of the value 0 so it does not show up? > > I want it to look like this: [1,2,3,4,5] > > > > This is a pretty simple question but I can't find the answer anywhere! Any help would be very appreciated! > > Thanks. > > one of the solutions > > x=[1,0,2,0]; > x=x(x~=0) > % x = 1 2 > > us Thanks! I knew this was a quick fix, I was just a little stumped :)
|
Pages: 1 Prev: "axis xy" vs. "imwrite" Next: Using outputfcn for ode15i with length(tspan) > 2 |