Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

For loop help... :(

1 Ansicht (letzte 30 Tage)
Walter Manns
Walter Manns am 11 Nov. 2011
Geschlossen: MATLAB Answer Bot am 20 Aug. 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.

Antworten (1)

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

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by