• 热门标签

当前位置: 主页 > 航空资料 > 航空制造 >

时间:2011-02-04 12:13来源:蓝天飞行翻译 作者:admin
曝光台 注意防骗 网曝天猫店富美金盛家居专营店坑蒙拐骗欺诈消费者

signs or decimal points). If a number does not fit, it is rounded to a value which
does fit in C characters. If necessary, an exponent will be created, still within the
reserved space of C characters. In that case the number of decimal places will
be reduced (displaying an exponent typically takes four characters, e.g. ‘E+25’).
Leading spaces will be used for numbers that require less than C characters.
Note: values of C smaller than 6 are not accepted and will be automatically converted
to C = 6! This prevents problems that may occur when trying to show very
large numbers in too few characters. However, you may still encounter strange
results if you reserve a very small space for large numbers.
T = num2str2(X) returns a string T with 6 characters.
12.5.4 SCREENSIZE
The utility SCREENSIZE is used to quickly obtain the current screen dimensions and
express them in several units of measurements. It is particularly useful for the positioning
of figures and graphical user-interface windows.
Usage:
s = screensize returns the screen dimensions in pixels,
s = screensize(units) returns the screen dimensions in the units of measurement
represented by the input string units.
Valid values of the string variable units are ’inches’, ’centimeters’, ’normalized’,
’points’, ’pixels’ and ’characters’. Notice that the quotes must be included.
The current screen dimensions are returned into the vector s, which is defined as
follows:
s = [left, bottom, width, height]
where left and bottom are the coordinates of the bottom left point of the screen, and
width and height represent the screen width and -height, expressed in the requested
units of measurement. For pixel units, the coordinate pair [left,bottom] will always be
equal to [1,1]; for all other units of measurement, this pair will be equal to [0,0].
12.5.5 TXTMENU
The utility TXTMENU can be used to display a menu of choices for user input in
the MATLAB command window. The function mimics the behavior of the MENU
command from older MATLAB versions, which did not yet provide graphical userinterface
functions. TXTMENU differs from the MENU command in MATLAB version
4 or later in that it will always use the command-window regardless of the
graphical capabilities of the workstation.
12.6. Model-specific helper functions 217
Usage:
choice = txtmenu(header, item1, item2, ..., item_n) displays a header string,
followed in sequence by the menu-item strings: item1, item2, ... , item_n. The
number of the selected menu-item will be returned into the scalar variable choice.
There is no upper limit to the total number of menu items.
choice = txtmenu(header, itemlist) where itemlist is a string cell array is also a
valid syntax.
Example:
K = txtmenu(’Choose a colour’,’Red’,’Blue’,’Green’) will display the following
menu in the command window:
Choose a colour:
1) Red
2) Blue
3) Green
Select a menu number:
The number entered by the user will be returned into the variable K. For instance,
choosing Blue from the example menu above will return K = 2.
12.6 Model-specific helper functions
The support functions discussed in the previous sections were quite generic in nature;
they can easily be adapted for other purposes than the FDC toolbox if desired.
In addition, the toolbox includes some specialised support utilities which assist with
the definition of aircraft model parameters and the post-processing of aircraft simulation
results. Helper functions for the autopilot models and open-loop example
functions will be treated later in their respective chapters.
12.6.1 MODBUILD
The MATLAB macro MODBUILD is used to build a datafile containing aerodynamic,
propulsive, geometrical, and mass-distribution parameters for the SIMULINK model
of the Beaver dynamics. To maintain flexibility, these parameters have not been hardwired
within the SIMULINK model itself, but are read from the MATLAB workspace
each time the model is initialised. Obviously this makes it necessary to load the parameters
into the MATLAB workspace before applying analytical tools (e.g. simulation,
linearisation, or trimming).
For the Beaver model, the parameters have been sorted into four variables:
1. the matrix AM (‘Aerodynamic Model’), which contains the aerodynamic parameters,
i.e., the stability and control derivatives of the Beaver,
2. the matrix EM (‘Engine Model’), which contains the propulsive stability and
control derivatives,
218 Chapter 12. Support functions reference
3. the vector GM1 (‘Geometry & Mass distribution’), which contains the basic
 
中国航空网 www.aero.cn
航空翻译 www.aviation.cn
本文链接地址:FDC 1.4 – A SIMULINK Toolbox for Flight Dynamics and Contro(98)