FormationControlSimulation/SOURCE/genPlotFncDotRobot.m

16 lines
408 B
Matlab
Raw Permalink Normal View History

2019-06-20 14:36:48 +07:00
function fPlot = genPlotFncDotRobot(corRobot)
str_tmp = " fPlot = @(t) plot( [";
for i = 1:2:length(corRobot)
str_tmp = strcat( str_tmp, sprintf("y'(%i,t), ",i));
endfor
str_tmp = strcat( str_tmp, sprintf("], ["));
for i = 2:2:length(corRobot)
str_tmp = strcat( str_tmp, sprintf("y'(%i,t), ",i));
endfor
str_tmp = strcat( str_tmp, sprintf("], \"^\");"));
eval(str_tmp)
endfunction