w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Matlab - reading in a variable and every 15 time steps and setting the that variable equal to the value read in for the following 15 time steps

Hey this solution should work. I have no Idea what your "real" program is doing so its still kind of abstract. If you got any questions feel free to comment.

l=0; %variable for your Temperature (here Temperature1)
for k=2:1:600
    if mod(k-2,15)==0 %using k-2 because your loop starts with 2. You could
also use k if you predefine tmp_Temperature as Temperature1(1)
        l=l+1;
        tmp_Temperature = Temperature1(l);
    end
    Here is your code with tmp_Temperature beeing your Temperature

end




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.