I have two expressions in MATLAB that represent a 365×24 matrix. The first expression has 10, 365×24 matrices and is therefore
PV_power_output(:,:,K)
and the second expression which is again 365×24 but with three possible matrices therefore is
WT_energy_supply(:,:,M);ode here
Now, I am looking to create a third matrix that adds the elements in the same position above and thus form a 365×24 matrix. However I want a set of matrix with all possible combinations of the two expressions shown above (therefore this matrix must be 365x24x30.
How do I go about this?
What about the bsxfun function in MATLAB?
Expand the original matrices (which for clarity I name
aandb) with repmat and then just add them, bsxfun is not needed.Update
It looks fine to me. Of course you’ll have to replace my variables
aandbwith your variablesPV_power_outputandWT_energy_supply.