Commit b2fe8b91 authored by Aaron Erhardt's avatar Aaron Erhardt
Browse files

Improve 3D-plot section


Signed-off-by: default avatarAaron Erhardt <aaron.erhardt@t-online.de>
parent 69ae1bda
Pipeline #583 passed with stage
in 1 minute and 54 seconds
......@@ -528,13 +528,32 @@ handle.Children(1).LineWidth = 2; % get line from handle and change width
plot3(x, y, z);
```
### Meshgrid
### Surfaces
Generate grid
```matlab
% Generate grid from matrices with duplicate rows of x and duplicate columns of y
[X Y] = meshgrid(x, y); % Matrices with dimension length(x) x length(y)
mesh(X, Y) % Plot mesh
Z = X.^2 - Y % use (uppercase!) X and Y to calculate Z
mesh(X, Y, Z) % Plot mesh with Z coordinate
```
Mesh surface plot
```matlab
mesh(X, Y) % Plot mesh (using X and Y from meshgrid)
Z = X.^2 - Y % use (uppercase!) X and Y to calculate Z
mesh(X, Y, Z) % Plot mesh with Z coordinate
```
Surface plot
```matlab
% Grids are simply specified by matrices of coordinates
[X Y] = meshgrid(x, y, z); % Generate grid
mesh(X, Y) % Plot mesh
mesh(X, Y, Z) % Plot mesh with Z coordinate
surf(X, Y, Z) % Similar to mesh but always with Z coordinate
```
# Functions
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment