generate a matrix for each hour and every time it tells me -This is day 1 the ext temp is __ and these are temp for hour __ and display the matrix

3 views (last 30 days)
Student
Student on 21 Oct 2021
Edited: Student on 21 Oct 2021
Hello
I want the code to tell me that this is day __ and the exterior temp is __ this is the temperature for hour ___
Can you please help me fix it? Thank you.
Absorb = 0.6000
This is day 0001
This outside temperature is -2.9904e+00
This is the temperature distribution of hour 1
This outside temperature is -4.4889e+00
This is the temperature distribution of hour 2
This outside temperature is -0005
This is the temperature distribution of hour 3
This outside temperature is -4.4889e+00
This is the temperature distribution of hour 4
This outside temperature is -2.9904e+00
This is the temperature distribution of hour 5
This outside temperature is -6.0660e-01
This is the temperature distribution of hour 6
This outside temperature is 2.5000e+00
This is the temperature distribution of hour 7
This outside temperature is 6.1177e+00
This is the temperature distribution of hour 8
This outside temperature is 0010
This is the temperature distribution of hour 9
This outside temperature is 1.3882e+01
This is the temperature distribution of hour 10
This outside temperature is 1.7500e+01
This is the temperature distribution of hour 11
This outside temperature is 2.0607e+01
This is the temperature distribution of hour 12
This outside temperature is 2.2990e+01
This is the temperature distribution of hour 13
This outside temperature is 2.4489e+01
This is the temperature distribution of hour 14
This outside temperature is 0025
This is the temperature distribution of hour 15
This outside temperature is 2.4489e+01
This is the temperature distribution of hour 16
This outside temperature is 2.2990e+01
This is the temperature distribution of hour 17
This outside temperature is 2.0607e+01
This is the temperature distribution of hour 18
This outside temperature is 1.7500e+01
This is the temperature distribution of hour 19
This outside temperature is 1.3882e+01
This is the temperature distribution of hour 20
This outside temperature is 1.0000e+01
This is the temperature distribution of hour 21
This outside temperature is 6.1177e+00
This is the temperature distribution of hour 22
This outside temperature is 2.5000e+00
This is the temperature distribution of hour 23
This is day 0002
This outside temperature is -2.9904e+00
This is the temperature distribution of hour 1
This outside temperature is -4.4889e+00
This is the temperature distribution of hour 2
This outside temperature is -0005
This is the temperature distribution of hour 3
This outside temperature is -4.4889e+00
This is the temperature distribution of hour 4
This outside temperature is -2.9904e+00
This is the temperature distribution of hour 5
This outside temperature is -6.0660e-01
This is the temperature distribution of hour 6
This outside temperature is 2.5000e+00
This is the temperature distribution of hour 7
This outside temperature is 6.1177e+00
This is the temperature distribution of hour 8
This outside temperature is 0010
This is the temperature distribution of hour 9
This outside temperature is 1.3882e+01
This is the temperature distribution of hour 10
This outside temperature is 1.7500e+01
This is the temperature distribution of hour 11
This outside temperature is 2.0607e+01
This is the temperature distribution of hour 12
This outside temperature is 2.2990e+01
This is the temperature distribution of hour 13
This outside temperature is 2.4489e+01
This is the temperature distribution of hour 14
This outside temperature is 0025
This is the temperature distribution of hour 15
This outside temperature is 2.4489e+01
This is the temperature distribution of hour 16
This outside temperature is 2.2990e+01
This is the temperature distribution of hour 17
This outside temperature is 2.0607e+01
This is the temperature distribution of hour 18
This outside temperature is 1.7500e+01
This is the temperature distribution of hour 19
This outside temperature is 1.3882e+01
This is the temperature distribution of hour 20
This outside temperature is 1.0000e+01
This is the temperature distribution of hour 21
This outside temperature is 6.1177e+00
This is the temperature distribution of hour 22
This outside temperature is 2.5000e+00
This is the temperature distribution of hour 23
This is day 0003
This outside temperature is -2.9904e+00
This is the temperature distribution of hour 1
This outside temperature is -4.4889e+00
This is the temperature distribution of hour 2
This outside temperature is -0005
This is the temperature distribution of hour 3
This outside temperature is -4.4889e+00
This is the temperature distribution of hour 4
This outside temperature is -2.9904e+00
This is the temperature distribution of hour 5
This outside temperature is -6.0660e-01
This is the temperature distribution of hour 6
This outside temperature is 2.5000e+00
This is the temperature distribution of hour 7
This outside temperature is 6.1177e+00
This is the temperature distribution of hour 8
This outside temperature is 0010
This is the temperature distribution of hour 9
This outside temperature is 1.3882e+01
This is the temperature distribution of hour 10
This outside temperature is 1.7500e+01
This is the temperature distribution of hour 11
This outside temperature is 2.0607e+01
This is the temperature distribution of hour 12
This outside temperature is 2.2990e+01
This is the temperature distribution of hour 13
This outside temperature is 2.4489e+01
This is the temperature distribution of hour 14
This outside temperature is 0025
This is the temperature distribution of hour 15
This outside temperature is 2.4489e+01
This is the temperature distribution of hour 16
This outside temperature is 2.2990e+01
This is the temperature distribution of hour 17
This outside temperature is 2.0607e+01
This is the temperature distribution of hour 18
This outside temperature is 1.7500e+01
This is the temperature distribution of hour 19
This outside temperature is 1.3882e+01
This is the temperature distribution of hour 20
This outside temperature is 1.0000e+01
This is the temperature distribution of hour 21
This outside temperature is 6.1177e+00
This is the temperature distribution of hour 22
This outside temperature is 2.5000e+00
This is the temperature distribution of hour 23
This is day 0004
This outside temperature is -2.9904e+00
This is the temperature distribution of hour 1
This outside temperature is -4.4889e+00
This is the temperature distribution of hour 2
This outside temperature is -0005
This is the temperature distribution of hour 3
This outside temperature is -4.4889e+00
This is the temperature distribution of hour 4
This outside temperature is -2.9904e+00
This is the temperature distribution of hour 5
This outside temperature is -6.0660e-01
This is the temperature distribution of hour 6
This outside temperature is 2.5000e+00
This is the temperature distribution of hour 7
This outside temperature is 6.1177e+00
This is the temperature distribution of hour 8
This outside temperature is 0010
This is the temperature distribution of hour 9
This outside temperature is 1.3882e+01
This is the temperature distribution of hour 10
This outside temperature is 1.7500e+01
This is the temperature distribution of hour 11
This outside temperature is 2.0607e+01
This is the temperature distribution of hour 12
This outside temperature is 2.2990e+01
This is the temperature distribution of hour 13
This outside temperature is 2.4489e+01
This is the temperature distribution of hour 14
This outside temperature is 0025
This is the temperature distribution of hour 15
This outside temperature is 2.4489e+01
This is the temperature distribution of hour 16
This outside temperature is 2.2990e+01
This is the temperature distribution of hour 17
This outside temperature is 2.0607e+01
This is the temperature distribution of hour 18
This outside temperature is 1.7500e+01
This is the temperature distribution of hour 19
This outside temperature is 1.3882e+01
This is the temperature distribution of hour 20
This outside temperature is 1.0000e+01
This is the temperature distribution of hour 21
This outside temperature is 6.1177e+00
This is the temperature distribution of hour 22
This outside temperature is 2.5000e+00
This is the temperature distribution of hour 23
This is day 0005
This outside temperature is -2.9904e+00
This is the temperature distribution of hour 1
This outside temperature is -4.4889e+00
This is the temperature distribution of hour 2
This outside temperature is -0005
This is the temperature distribution of hour 3
This outside temperature is -4.4889e+00
This is the temperature distribution of hour 4
This outside temperature is -2.9904e+00
This is the temperature distribution of hour 5
This outside temperature is -6.0660e-01
This is the temperature distribution of hour 6
This outside temperature is 2.5000e+00
This is the temperature distribution of hour 7
This outside temperature is 6.1177e+00
This is the temperature distribution of hour 8
This outside temperature is 0010
This is the temperature distribution of hour 9
This outside temperature is 1.3882e+01
This is the temperature distribution of hour 10
This outside temperature is 1.7500e+01
This is the temperature distribution of hour 11
This outside temperature is 2.0607e+01
This is the temperature distribution of hour 12
This outside temperature is 2.2990e+01
This is the temperature distribution of hour 13
This outside temperature is 2.4489e+01
This is the temperature distribution of hour 14
This outside temperature is 0025
This is the temperature distribution of hour 15
This outside temperature is 2.4489e+01
This is the temperature distribution of hour 16
This outside temperature is 2.2990e+01
This is the temperature distribution of hour 17
This outside temperature is 2.0607e+01
This is the temperature distribution of hour 18
This outside temperature is 1.7500e+01
This is the temperature distribution of hour 19
This outside temperature is 1.3882e+01
This is the temperature distribution of hour 20
This outside temperature is 1.0000e+01
This is the temperature distribution of hour 21
This outside temperature is 6.1177e+00
This is the temperature distribution of hour 22
This outside temperature is 2.5000e+00
This is the temperature distribution of hour 23

Accepted Answer

Cris LaPierre
Cris LaPierre on 21 Oct 2021
Edited: Cris LaPierre on 21 Oct 2021
Your code is already doing that (though I did add a semicolon to stop it from printing out T in every loop). If you want it to give the day, hour and temp for every temp, have a single fprintf statement at the end of your loop. It might look like this
fprintf('This is day %0.4d and the exterior temp is %0.4d this is the temperature for hour %d\n', ...
Day,T_o(Hour),Hour)
  3 Comments

Sign in to comment.

More Answers (0)

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by