KerMor  0.9
Model order reduction for nonlinear dynamical systems and nonlinear approximation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HillGen.m
Go to the documentation of this file.
1 namespace models{
2 namespace golf{
3 
4 
5 /* (Autoinserted by mtoc++)
6  * This source code has been filtered by the mtoc++ executable,
7  * which generates code that can be processed by the doxygen documentation tool.
8  *
9  * On the other hand, it can neither be interpreted by MATLAB, nor can it be compiled with a C++ compiler.
10  * Except for the comments, the function bodies of your M-file functions are untouched.
11  * Consequently, the FILTER_SOURCE_FILES doxygen switch (default in our Doxyfile.template) will produce
12  * attached source files that are highly readable by humans.
13  *
14  * Additionally, links in the doxygen generated documentation to the source code of functions and class members refer to
15  * the correct locations in the source code browser.
16  * However, the line numbers most likely do not correspond to the line numbers in the original MATLAB source files.
17  */
18 
19 class HillGen
20  :public handle {
39  public:
40 
41  hillcount = 0;
73  public:
74 
75  HillGen() {
76  }
77 
78 
79  function generate() {
80  [hxpos,hypos] = equidisthills(hillcount);
81  hills = [hxpos hypos];
82  randomizehills; /* Fügt automatisch die beiden Spalten mit Höhe+Radius ein, und plottet */
83 
84  }
91  function [h , r ] = generatehills(maxheight,maxrad,minrad) {
92  h = maxheight*2*(rand(hills,1)-0.5);
93  /* Radien der Hügel */
94  r = (maxrad-minrad)*rand(hills,1)+minrad;
95  /* Erzeugt zufällige Hügel */
96  }
105  function randomize() {
107  hills(:,3) = h; hills(:,4) = r;
108  /* Lochdaten anpassen */
109  HZ = green(HX,HY);
110  plotgreen();
111  /* Erzeugt neue höhen für das Gras */
112  }
113 
114 
115  function [xpos , ypos ] = equidisthills() {
116  global area;
117  xhills = round(sqrt((area(2)-area(1))/(area(4)-area(3))*hills));
118  yhills = round(hills/xhills);
119  xdist = (area(2)-area(1))/(xhills+1);
120  ydist = (area(4)-area(3))/(yhills+1);
121  /* Initialisieren */
122  xpos = zeros(hills,1); ypos = xpos;
123  /* Positionieren */
124  for hill = 0:hills-1
125  xpos(hill+1) = area(1) + (mod(hill,xhills)+1)*xdist;
126  ypos(hill+1) = area(3) + (floor(hill/xhills)+1)*ydist;
127  end
128  /* Erzeugt eine äquidistante Verteilung von Hügeln im Gelände */
129  }
130 
131 
132 
133 };
134 }
135 }
136 
hillcount
Einstellungen für zufällige Hügel Angabe eines Wertes > 0 erstellt zufällige hügel der angegebenen Anzahl ...
Definition: HillGen.m:41
max_hillradius
Maximaler Radius in Meter.
Definition: HillGen.m:58
function randomize()
Definition: HillGen.m:105
Matlab's base handle class (documentation generation substitute)
HillGen:
Definition: HillGen.m:19
min_hillradius
Minimaler Radius in Meter.
Definition: HillGen.m:65
function [ xpos , ypos ] = equidisthills()
Definition: HillGen.m:115
function [ h , r ] = generatehills(maxheight, maxrad, minrad)
Höhen, zwischen -1 und 1.
Definition: HillGen.m:91
max_hillheight
Höhe in Meter.
Definition: HillGen.m:51
function generate()
Orte der Hügel.
Definition: HillGen.m:79