"Barry " <barryoconnell2@gmail.com> wrote in message <i4gkor$qom$1@fred.mathworks.com>...
> A= 48x365 array of data ranging from 1501000.
> B= 1x365 ranging from 110
> C= 1x365 data ranging from 2035
> F= 300
>
> What I want to end up with is 48x365.
> I want to add values=F to A starting at the number in the matrix B for h rows.
> I want to subtract values from A starting at C for m rows.
> I Also want the sum of A to be equal to the sum of C and i don't want A to be negative ever.
>
> So F x h = m x whatever value, it can be constant but if it gets too large subtracting it will turn A negative
>
> So what i am trying to do is simulate storage If anybody could help me with constant number it would be very helpful and also any ideas on how to go about increasing it and keeping it at either 0 or above
I don't know how you could possibly expect anybody to follow this explanation. Why is B 1x365 in your initial list of variables, and then a "number" in your description? What are h and m? What does "starting at C" mean when C is a 1x365 array? How can the sum of A (which will be 1x365) and the sum of C (which will be a single number) be equal? And "F x h = m x whatever value" makes no sense at all.
Please show the code you've come up with so far. Give a small sample of input (make A no larger than, say, 10x10, and choose small B, C, and F as well), and tell us what your desired output would be for that input. Show the steps of your algorithm (in code or pseudocode, not in words). Otherwise, nobody has a chance of helping you.
