Looping output values back as input
显示 更早的评论
I'm pretty new to matlab and (programming in general). I've written a program that inputs 3 points' coordinates (assuming them to be circle centers) and outputs tangent point coordinates between those circles. My question is: how can I make the program take the output tangent points and run them back in as new inputs for a certain number of iterations? I'm sure I need to use a loop, but I'm not sure how to use it for this particular purpose.
回答(1 个)
Fangjun Jiang
2011-11-22
InputValue=1;
for k=1:NumberOfIteration
OutputValue=MyFunction(InputValue);
InputValue=MyFunction(OutputValue);
end
4 个评论
Alex
2011-11-22
Fangjun Jiang
2011-11-22
I am not clear about your question. Do you mean if-else statement? Type "help if" to see an example.
Alex
2011-11-25
Fangjun Jiang
2011-11-25
So, what is your question. You don't know how to use if-else statement in MATLAB?
类别
在 帮助中心 和 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!