# [Three-dimensional path planning] Three-dimensional trajectory planning of UAV based on matlab [including Matlab source code 270]

## 1. Introduction

1 Proposal of
ant colony algorithm Ant colony optimization (ACO), also known as ant algorithm, is a probabilistic algorithm used to find optimized paths. It was proposed by Marco Dorigo in his doctoral dissertation in 1992, and was inspired by the behavior of ants finding paths in the process of searching for food. Genetic algorithms are used in pattern recognition, neural networks, machine learning, industrial optimization control, adaptive control, biological sciences, social sciences, etc.
2 Basic principles of the algorithm

## 2. the source code

```clc;
X = 0 : 1 : 20 ;
Y = 0 : 1 : 20 ;
Z=[ 0.2  0.2  0.2  0.2  0.2  0.2  0.2  0.2  0.2  0.2  0.2  0.2  0.2  0.2  0.4  0.7  0.4  0.2  0.4  0.5  0.3 ;
0.2  0.2  0.3  0.2  0.2  0.3  0.2  0.2  0.2  0.2  0.2  0.1  0.2  0.4  0.3  0.6  0.5  0.3  0.3  0.3  0.2 ;
0.2  0.3  0.4  0.4  0.2  0.2  0.2  0.3 0.2  0.2  0.2  0.2  0.2  0.2  0.2  0.5  0.7  0.4  0.4  0.3  0.3 ;
0.2  0.3  0.3  0.6  0.3  0.4  0.3  0.2  0.2  0.3  0.6  0.4  0.3  0.2  0.4  0.3  0.8  0.6  0.7  0.4  0.4 ;
0.2  0.3  0.3  0.7  0.6  0.6  0.4  0.2  0.3  0.5  0.8  0.8  0.3  0.2  0.2  0.8  1.3 0.9  0.8  0.8  0.4 ;
0.2  0.3  0.6  0.9  0.8  0.8  0.6  0.3  0.4  0.5  0.4  0.5  0.4  0.2  0.5  0.5  1.3  0.6  1.0  0.9  0.3 ;
0.3  0.5  0.9  1.1  1.0  0.7  0.7  0.4  0.6  0.4  0.4  0.3  0.5  0.5  0.3  0.9  1.2  0.8  1.0  0.8  0.4 ;
0.3  0.5  0.8  1.1 1.1  1.0  0.8  0.7  0.7  0.4  0.5  0.4  0.4  0.5  0.4  1.1  1.3  0.7  1.0  0.7  0.6 ;
0.4  0.5  0.4  1.0  1.1  1.2  1.0  0.9  0.7  0.5  0.6  0.3  0.6  0.4  0.6  1.0  1.0  0.6  0.9  1.0  0.7 ;
0.3  0.5  0.6  1.1  1.2  1.0  1.0  1.1  0.9  0.4  0.4  0.5  0.5 0.8  0.6  0.9  1.0  0.5  0.8  0.8  0.9 ;
0.3  0.5  0.9  1.1  1.1  1.0  1.2  1.0  0.8  0.7  0.5  0.6  0.4  0.5  0.4  1.0  1.3  0.9  0.9  1.0  0.8 ;
0.3  0.3  0.5  1.2  1.2  1.1  1.0  1.2  0.9  0.5  0.6  0.4  0.6  0.6  0.3  0.6  1.2  0.8  1.0  0.8  0.5 ;
0.2  0.3  0.4  0.9  1.1  1.0  1.1  1.1  0.7  0.4  0.4  0.4  0.3  0.5  0.5  0.8  1.1  0.8  1.1  0.9  0.3 ;
0.2  0.2  0.9  1.1  1.2  1.2  1.1  1.1  0.6  0.3  0.5  0.3  0.2  0.4  0.3  0.7  1.0  0.7  1.2  0.8  0.4 ;
0.2  0.4  1.0  1.0  1.1  1.1  1.1  1.1  0.6 0.3  0.4  0.4  0.2  0.7  0.5  0.9  0.7  0.4  0.9  0.8  0.3 ;
0.2  0.3  1.0  1.0  1.0  1.2  1.0  1.1  0.8  0.3  0.2  0.2  0.2  0.5  0.3  0.6  0.6  0.8  0.7  0.6  0.5 ;
0.2  0.2  0.9  0.7  1.0  1.0  1.0  0.7  0.5  0.3  0.2  0.2  0.2  0.6  0.2  0.8  0.7  0.9 0.5  0.5  0.4 ;
0.2  0.2  0.4  0.2  1.0  1.1  0.9  0.4  0.3  0.3  0.5  0.3  0.2  0.2  0.2  0.7  0.3  0.6  0.6  0.3  0.4 ;
0.2  0.3  0.3  0.2  0.3  1.0  0.4  0.5  0.3  0.3  0.3  0.3  0.2  0.2  0.2  0.6  0.5  0.4  0.4  0.2  0.2 ;
0.3  0.2  0.2  0.2  0.2 0.4  0.3  0.3  0.3  0.3  0.4  0.2  0.2  0.2  0.2  0.4  0.4  0.4  0.3  0.2  0.2 ;
0.2  0.2  0.2  0.2  0.2  0.2  0.4  0.4  0.3  0.2  0.3  0.2  0.1  0.2  0.2  0.4  0.3  0.2  0.2  0.2  0.2 ];
[x,y] = meshgrid( 1 : .1 : 20 , 1 : .1 : 20 );
z=interp2(X,Y,Z,x,y, 'spline' );
surf(x,y,z);
hold on
X1=[ 2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  18  19  18  19  18 ];
Y1=[ 1  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  19  19 ];
= Zl [ .300000  0.400000  0.500000  0.600000  0.700000  0.800000  0.900000  0.900000  0.900000  0.900000  0.900000  0.900000  0.900000  0.900000  0.900000  0.900000  0.800000  0.700000  0.600000  0.500000  0.400000  .300000 ]
duplicated code```

Version: 2014a