speed regulation loop; how to start from non zero value?
2 次查看(过去 30 天)
显示 更早的评论
I have a speed regulation loop with the PID and a transfer function. I generated the profile speed input from the "signal builder" and I need to start the loop from the non-zero value. How can I accomplish it?
1 个评论
回答(1 个)
Adam Danz
2018-9-21
编辑:Adam Danz
2018-9-21
The question is vague but I think this is what you're looking for.
values = [-10 : 10]; %Here are the negative and positive values you need in the loop
myVariable = nan(size(values)); %allocate loop variable
for i = 1:length(values) %Loop through each value of 'values'
myVariable = doSomething(values(i)); % Here is your code that references 'values'
end
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!