Path Planning and Cost Functions

1 次查看(过去 30 天)
Ali Ali
Ali Ali 2019-2-26
want help of dividing a region in multi for particle moving from position to another. and the cost function are different from region to another like if in region 1 is (x+y) then in region 2 with be (x+y+4). so, what is the coding will be for this case?
plz, see attached for your reference.

回答(1 个)

SandeepKumar R
SandeepKumar R 2019-3-5
function [z]=f(r)
if r>0 & r<r1
z=x+y
elseif r>r2 & r>r1
z=x+y+4
end
Use conditional statements to get piecewise functions

类别

Help CenterFile Exchange 中查找有关 Particle Swarm 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by