Info
This question is closed. Reopen it to edit or answer.
Help Assigning values of large matrix into kth customer over 24 hours of time table
1 view (last 30 days)
Show older comments
Hi i have a 1511x65 double matrix. as picture shows... column 1 is data for 1 customer power usage over 24 hours in 63 days. so 63 x 24 = 1511. which is why its 1511x65..where 65 is the amount of customers.
so i want to make a for loop so i can call one and/or all customers power usage over 24 hours. since it is 63 days envolved..i take the mean of the time for example 3 o'clock of all the 63 days. and i will end up with 1 value instead of 63 different values in the end..(this i know how to) i have made a manual code for 1 customer..but is there a way to make it a loop for all of them without the manual way. here is the manual code:
customer1 = x(:,1);
trow = 24;
tcol = ceil(length(customer1)/trow);
k1 = [customer1; nan(tcol*trow-length(customer1),1)];
k1 = reshape(k1,trow,tcol);
time = [0:23]';
plot(time,mean(k1,2))
regards a curious matlab user :D
So the result could be after the for loop:
when i call, lets say customer 5 i should be able to do this:
customer5 = k1(:,5) and i have a matrix of: 24x1 of customer 5.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/160638/image.jpeg)
0 Comments
Answers (0)
This question is closed.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!