Anda di halaman 1dari 2

Q2.

9
-An imaginary operator is the part of a complex number that defines the magnitude of the part
of the complex number at right angles to the real number part.
-These operators provide the ability to extract the real and imaginary parts of a complex type.
These extensions have been implemented to ease the porting applications developed with GNU
C.
-The var_identifier is the name of a previously declared complex variable. The __real__
operator returns the real part of the complex variable, while the __imag__ operator returns the
imaginary part of the variable. If the operand of these operators is an lvalue, the resulting
expression can be used in any context where lvalues are allowed. They are especially useful in
initializations of complex variables, and as arguments to calls to library functions such as printf
and scanf that have no format specifiers for complex types. For example:
float _Complex myvar;
__imag__(myvar) = 2.0f;
__real__(myvar) = 3.0f;
initializes the imaginary part of the complex variable myvar to 2.0i and the real part to 3.0, and
printf("myvar = %f + %f * i\n", __real__(myvar), __imag__(myvar));
prints:
myvar = 3.000000 + 2.000000 * i

Q2.10
-subplot(m,n,p) divides the current figure into an m-by-n grid and creates axes in the position
specified by p. MATLAB® numbers subplot positions by row. The first subplot is the first column
of the first row, the second subplot is the second column of the first row, and so on. If axes
exist in the specified position, then this command makes the axes the current axes
-subplot(m,n,p,'replace') deletes existing axes in position p and creates new axes.
-subplot(m,n,p,'align') creates new axes so that the plot boxes are aligned. This option is the
default behavior.
-subplot(m,n,p,ax) converts the existing axes, ax, into a subplot in the same figure.
-subplot('Position',pos) creates axes in the custom position specified by pos. Use this option to
position a subplot that does not align with grid positions. Specify pos as a four-element vector
of the form [left bottom width height]. If the new axes overlap existing axes, then the new axes
replace the existing axes.
-subplot(___,Name,Value) modifies axes properties using one or more name-value pair
arguments. For a list of properties, see Axes Properties. Set axes properties after all other input
arguments.

Q2.13
-The operator ^ is the matrix power,while the operator .^ is the element-wise power

Q2.19
-The purpose of the axis command is to set the scale of the current plot and the purpose of the
grid command is to draw the grid lines on the current plot.

Anda mungkin juga menyukai