Prev: fdesign.arbmag, how to specify a "don't care region"
Next: Which mathematical model to use to calculate transfer function?
From: Bill on 7 Jul 2010 05:10 How do you concatenate all of the values generated by the following for loop to make a vector? for i=1:3 a=exp(i) end
From: Oleg Komarov on 7 Jul 2010 05:44 "Bill " <user12345678(a)hotmail.com> wrote in message <i11g9e$dvu$1(a)fred.mathworks.com>... > How do you concatenate all of the values generated by the following for loop to make a vector? > > for i=1:3 > a=exp(i) > end Do not concatenate inside a loop if you know the final dimension in advance. Preallocate the output and assign it: a = zeros(1,3); for ii=1:3 a(ii) = exp(ii) end Also, don't use "i" (imaginary unit) because it is already in the standard matlab "library". Oleg
From: James Tursa on 7 Jul 2010 06:15
"Bill " <user12345678(a)hotmail.com> wrote in message <i11g9e$dvu$1(a)fred.mathworks.com>... > How do you concatenate all of the values generated by the following for loop to make a vector? > > for i=1:3 > a=exp(i) > end a = exp(1:3) James Tursa |