I am calculation Cooling Loads.
I need to find Total Cooling Load (Qtotal)
Total Cooling Load is technically the sum of my first floor (QF1), second floor (QF2), sensible heat gain by infiltration (Qis) and latent heat gain by infiltration (Qil).
So,
Qtotal = QF1+QF2+Qis+Qil;
But due to hours of occupation,
QF1 is a 1:12 matrix
QF2 is a 1:8 matrix
Qis and Qil are both 1:24 matrix
ANy help on how i can go about calculating this. Thanks.

1 Comment

Adam Danz
Adam Danz on 2 Oct 2019
Edited: Adam Danz on 2 Oct 2019
The 'hours of occupation' comment leads me to believe that each vector contains samples of a measurment across time but those time stamps aren't aligned. If that's the case, hopefully you have the timestamps for each vector in which case you can interpolate using interp1(). If the sampling rates are fixed but unequal between vectors, you could also look into resample(). Ultimately, it might be beneficial to organize the data into a timetable with 1 column of timstamps and the other columns would contain your measurements.

Sign in to comment.

 Accepted Answer

Star Strider
Star Strider on 2 Oct 2019
I would creat all the vectors initially as zeros(1,24), then fill in the elements corresponding to the hours of occupation in QF1 and QF2. Then, all the matrices align and the addition proceeds.

6 Comments

this is what i think is the best course of action. i am just unsure about how to proceed.
% ZONE COOLING LOAD (Actual)
QZ1 = zeros(1,24);
QZ2 = zeros(1,24);
QZ3 = zeros(1,24);
QZ4 = zeros(1,24);
QZ5 = zeros(1,24);
QZ6 = zeros(1,24);
QZ7 = zeros(1,24);
QR = zeros(1,24);
QZ1 = Qz1(1,8:20);
QZ2 = Qz2(1,8:20);
QZ3 = Qz3(1,8:18);
QZ4 = Qz4(1,8:18);
QZ5 = Qz5(1,8:18);
QZ6 = Qz6(1,8:18);
QZ7 = Qz7(1,8:18);
QR = Q_R(1,8:18);
% FLOOR COOLING LOAD
QF1 = QZ1+QZ2;
QF2 = QZ3+QZ4+QZ5+QZ6+QZ7+QR;
% TOTAL COOLING LOAD
Qtotal = QF1+QF2+Qis+Qil;
but i stil get matrix dimensions must agree.
Correct idea, slightly in error as to the addressing.
Try this:
QZ1 = zeros(1,24); % Preallocate
. . .
Qz1 = rand(1,13); % Create Test Data
. . .
QZ1(8:20) = Qz1 % Assign
The preallocation is the correct approach. You then need to index the destination vector (‘QZ1’ in this example) with the values of ‘Qz1’ (and the others as appropriate). I am not quite certain what ‘Qz1’ and the others look like, however if they are similar in structure to my test vectors, this should work.
It did exactly what i needed. Thank you very much!
As always, my pleasure!

Sign in to comment.

More Answers (0)

Categories

Find more on Particle & Nuclear Physics in Help Center and File Exchange

Products

Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!