add two matrix



hello,
I'd like be able to add, row by row, the values of two simple matrix
A(8760,1) and B(8760,1) to obtain one matrix C(8760,1).
Presently I use

for i=1:8760
C = A(i,1)+B(i,1)
end

or in another exemple:

for i=1:8760
P = (max(0.00001,Q(i,1)*expert(1,4)))-R(i,1);
end

but this way of making the calculations, with For loops is very slow,
Are there other faster ways to do it???
Thanks you for your help
max
.



Relevant Pages

  • Re: How to boost speed
    ... There are 3 nested loops that each run about N times. ... My back of the envelope calculations estimate approx. ... Assume each iteration takes one machine cycle. ... adding optional arguments for size or passing array slices to your ...
    (comp.lang.fortran)
  • Re: efficient way of processing m combinations of n numbers in p sets
    ... Mike wrote: ... > or the increment is too low, ... > these types of calculations in under 2 seconds. ... > numbers I would only need 3 for loops to work through all of the ...
    (microsoft.public.vb.general.discussion)
  • Re: Problems with multiplications of doubles and/or floats
    ... lot of calculations in it, they all work fine except the one mentioned ... //Get position of first node ... ElleNodePrevPosition(index, & prev); ...
    (comp.lang.cpp)
  • Re: storing data in an array?
    ... because I cannot figure out how to store data in an ... I'm using a series of "for" loops in my calculations, ... array, so that I can plot each of those points against time? ...
    (comp.soft-sys.matlab)
  • Re: [PHP] Re: deamon / server
    ... > For exemple, the script make some calculations, but niced 19 in background ... > the calculations are in progress, the user make a tcp query. ... > Or another exemple, a php-gtk 3D isometric game, with a PHP server to put ...
    (php.general)