Hi!
I'm trying to find the most efficient way to write arrays to a zeros matrix. I have another function that creates the array, now I'm just trying to figure out the most efficient way to store it in a matrix. I also need to lag the arrays by 1 column and 1 row for subsequent arrays as well. For those of you who are familiar with Unit Hydrograph convolution, that's what I'm doing. The reason I need this to be as fast as possible is because I'm going to be running this code for like 20,000 time steps. Also, I should mention I'm a Matlab Noob.
Here's the array I've already calculated:
I want to put it in this zeros matrix:
What I want to output is this:
The reason I need to put the arrays in a matrix is because I need to sum all of the rows across the columns and place into a new array. I should also mention that the arrays might be variable lengths and not all will be the same magnitude, as shown here, during actual implementation of the code depending on the storm event.
Thanks for any help you can provide!
Best Answer