Hello, I want to get the array [25 25 25 25 25] as the end value of Batt. However, the loop overwrites and I get [25 25 25]. I can't seem to figure out how to append the n_EVs(2) from the next column.
n_AGs = 2;n_EVs = [2 3];for j=1:n_AGs Batt(1,1:n_EVs(j)) = 25;end
I specifically want to take the value of n_EVs from the array at each iteration and append the Batt at each iteration. For example:
In the first iteration it should give [25 25]. The second iteration should give [25 25 25 25 25] after appending [0 0 25 25 25] to [25 25].
Would appreciate any help. Best!
Best Answer