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

조회 수: 1 (최근 30일)
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

채택된 답변

Cris LaPierre
Cris LaPierre 2021년 10월 21일
편집: Cris LaPierre 2021년 10월 21일
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
Student
Student 2021년 10월 21일
Like for each hour it would put the values in the excel sheet.
say day 1: hour 1 goes in sheet 1 of excel file1 , hour 2 in sheet 2 of excel file1
day 2: hour 1 goes in sheet 1 of excel file2 , hour 2 in sheet 2 of excel file2

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by