Prev: "save" within a loop
Next: End of for loop very slow
From: mat001 on 11 May 2010 06:33 can any one explain what this line means if i need vol as output. its not working also. vol(a>=b) = s1./s2 .* a(a>=b)
From: ImageAnalyst on 11 May 2010 06:45 On May 11, 6:33 am, "mat001 " <priya.biom...(a)yahoo.co.in> wrote: > can any one explain what this line means > > if i need vol as output. > its not working also. > > vol(a>=b) = s1./s2 .* a(a>=b) ------------------------------------------------- It's finding elements of a where they're greater than b and then scaling them by the ratio of a1 & s2 in those locations, and sending the result to the same locations in vol. vol, a, b, s1, and s2 must all be the same size. Make sure that is the case. In particular, vol must be the same size BEFORE you execute that line, so make sure you do something like vol=a; vol=b; vol=zeros(size(a)); or something like that before to initialize it.
From: mat001 on 11 May 2010 07:18 ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <a4d617fe-432b-41da-9b77-597c757469f8(a)t17g2000yqg.googlegroups.com>... > On May 11, 6:33 am, "mat001 " <priya.biom...(a)yahoo.co.in> wrote: > > can any one explain what this line means > > > > if i need vol as output. > > its not working also. > > > > vol(a>=b) = s1./s2 .* a(a>=b) > > ------------------------------------------------- > It's finding elements of a where they're greater than b and then > scaling them by the ratio of a1 & s2 in those locations, and sending > the result to the same locations in vol. > > vol, a, b, s1, and s2 must all be the same size. Make sure that is > the case. > In particular, vol must be the same size BEFORE you execute that line, > so make sure you do something like > vol=a; > vol=b; > vol=zeros(size(a)); > or something like that before to initialize it. when i run error is ??? Error using ==> times Matrix dimensions must agree. a is matrix with size (100*700) b has 1*1 so ithis is error i want to check each element inside a compression to b
From: ImageAnalyst on 11 May 2010 08:03 Actually it should be okay that b is a scalar. The problem is most likely that you have not yet initialized vol. See my prior post. If you have, then what are the sizes of vol, s1, and s2?
From: mat001 on 11 May 2010 09:27
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <e6ec0436-dacc-40c6-83b7-96a074a7ce8a(a)d39g2000yqa.googlegroups.com>... > Actually it should be okay that b is a scalar. The problem is most > likely that you have not yet initialized vol. See my prior post. If > you have, then what are the sizes of vol, s1, and s2? s1 and s2 is just number vol is matrix of size 100*700 |