[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: help with vectorizing a for loop
From: |
Bård Skaflestad |
Subject: |
Re: help with vectorizing a for loop |
Date: |
Mon, 3 Oct 2011 14:03:27 +0200 |
On Mon, 2011-10-03 at 12:09 +0200, Rick T wrote:
> Greetings All
>
>
> I have a for loop that reads an array but I would like to vectorize it
> to see if will improve speed.
[snip]
> for ii=1:1:length(inner_freq)-1
>
>
> aa_sig_rebuilt=inner_freq(ii,2)*cos(2*pi*t*inner_freq(ii,1)+inner_freq(ii,3));
> aa_sig_combined=aa_sig_combined+aa_sig_rebuilt;
> end;
aa_sig_combined = sum(inner_freq(1:end-1,2) .* ...
cos(2*pi*t .* inner_freq(1:end-1,1) + ...
inner_freq(1:end-1,3)))
Sincerely,
--
Bård Skaflestad <address@hidden>
SINTEF ICT, Applied Mathematics
- help with vectorizing a for loop, Rick T, 2011/10/03
- Re: help with vectorizing a for loop,
Bård Skaflestad <=
- Re: help with vectorizing a for loop, Martin Helm, 2011/10/03
- Re: help with vectorizing a for loop, Thomas Weber, 2011/10/03
- Re: help with vectorizing a for loop, Rick T, 2011/10/04
- Re: help with vectorizing a for loop, Martin Helm, 2011/10/04
- Re: help with vectorizing a for loop, Rick T, 2011/10/04
- Re: help with vectorizing a for loop, Martin Helm, 2011/10/04
- Re: help with vectorizing a for loop, Martin Helm, 2011/10/04
- Re: help with vectorizing a for loop, Rick T, 2011/10/04
- Re: help with vectorizing a for loop, Martin Helm, 2011/10/05
- Re: help with vectorizing a for loop, Rick T, 2011/10/05