I have the vector
output = PV_out(:);
I am trying to break this down into some sort of form like – output(K) where output(1) is the first 8760 rows, output (2) is the next 8760 rows etc etc
The vector above is a 236520×1 vector and so I am trying to get 27 “sets” of matrices
does anyone know how to do this?
Thank you
This is a job for reshape:
This will create an 8760x1x27 matrix where each row is taken sequentially from the vector that was given to it. Note that you should be careful if you give it a matrix as the first input argument (rather than a vector): you should make sure you know in what order the values are being taken. (Leaving the empty
[]means it will automatically pick the right size for that dimension. You will still have an error if thenumelof the input isn’t evenly divisible by the dimensions you specify.)Edit: changed dimensions according to comment below.