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 comentario

Adam Danz
Adam Danz el 2 de Oct. de 2019
Editada: Adam Danz el 2 de Oct. de 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.

Iniciar sesión para comentar.

 Respuesta aceptada

Star Strider
Star Strider el 2 de Oct. de 2019

0 votos

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 comentarios

Anthony Hudaverdi
Anthony Hudaverdi el 2 de Oct. de 2019
this is what i think is the best course of action. i am just unsure about how to proceed.
Anthony Hudaverdi
Anthony Hudaverdi el 2 de Oct. de 2019
Editada: Anthony Hudaverdi el 2 de Oct. de 2019
% 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;
Anthony Hudaverdi
Anthony Hudaverdi el 2 de Oct. de 2019
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.
Anthony Hudaverdi
Anthony Hudaverdi el 2 de Oct. de 2019
It did exactly what i needed. Thank you very much!
Star Strider
Star Strider el 2 de Oct. de 2019
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Particle & Nuclear Physics en Centro de ayuda y File Exchange.

Productos

Versión

R2019b

Preguntada:

el 2 de Oct. de 2019

Comentada:

el 2 de Oct. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by