First value 20 in a growing matrix

3 ビュー (過去 30 日間)
Jo Betteley
Jo Betteley 2018 年 4 月 1 日
回答済み: Jo Betteley 2018 年 4 月 1 日
Hello all,
I got some help with the following code to log a ever growing matrix for cycles of temperature. Below is a representation of the code:
NOC =3; % number of cycles
RT=zeros(100,NOC); % running total
for y = 1:NOC
for x =1:100
if x ==1 &&Y>1
RT(x,Y) =RT(end,Y-1);
end
value(x) = 2*x;
if x ~=1
RT(x,Y) = value(x) +RT(x-1,Y)
end
end
end
what now alludes me, which is more than likely something simple, is as i am dealing with logging growing temperature i need the first value in the matrix to start at what i set ambient temperature at. would someone be able to help with that.
Thank you in advance

採用された回答

Jo Betteley
Jo Betteley 2018 年 4 月 1 日
Sorry, i just had a thought and managed to sort it. It was simple
under the
RT=zeros(100,NOC)
i added AT = 20 % ambient temperature
RT(1,1)=AT
Thank you

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by