- Index is forgotten
- When i=1 what value be in c(i-1)
- Assign first value for temperature before for loop
Looping through arrays with equation out
1 回表示 (過去 30 日間)
古いコメントを表示
Hi, I am trying to work on some large data 17200x2 ( need to construct temperature table before doing LSR )
with initial value To (temperature) = 1
a is constant
mV = milli volt
mVo = previous mV
let A= [ 0 1; 1 2; 2 3 ; 3 4; 4 5] % is timestep in second 0:0.001:17.2
and I need the following interations for n rows(17200)
my general function is (V-Vo/a) + To = T
so iter 1 , = To = 1
iter 2 , (2-1)/a + To = T1
iter 3 , ( 3-2)/a + T1 = T2
this should be recorded in column as looping
Here is what I have tried
mV = [A(:,1),A(:,4)]; % this is 17200x2 matrix
c = mV(:,2); % didnt quite work, so decided to extract single column 17200x1 to see if working for looping
for i = 1:length(c)
mt(i) = (c(i)-c(i-1))./(0.00005)+ mt % mt(temperature) needs to be recorded , for 17200 rows
end
THank you for any advise
0 件のコメント
回答 (1 件)
darova
2019 年 9 月 23 日
I have a few suggections
please use special button for code inserting
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!