Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

For loop help... :(

1 visualizzazione (ultimi 30 giorni)
Walter Manns
Walter Manns il 11 Nov 2011
Chiuso: MATLAB Answer Bot il 20 Ago 2021
Regards,
I'm working on a big code, but i'm having trouble in this section:
for k=1:(t-1)
fo(k) = ((time(k+1)-time(k))/2)*(10^((Tpf(k+1)-Tr)/z)+10^((Tpf(k)-Tr)/z));
foo = sum(fo);
if foo<ff
tc = tp;
elseif foo>=ff
tc = ......;
end
end
Time, tpf are vectors. Tr, z, tp, ff are constants.
Imaging a heating problem, where tp is my process time. I want, when foo reach ff ammount, the time tc (wich would me the "start cooling" time) get the value of that time(k) iteration as a contant. Because it's in the loop, if i use tc = time(k) it will keep changing. I want when my foo reach ff, get the time(k) = constant, so afterwards in my code, that tc gives the initiation of my cooling process.
Thanks, i hope i explained it decent. Any questions please ask.

Risposte (1)

Walter Manns
Walter Manns il 11 Nov 2011
i just found how, no worries.

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by