Saturday, July 25, 2009

Description COntinued...

blanks

A string of blanks

Syntax

  • blanks(n)

Description

blanks(n) is a string of n blanks.

Examples

blanks is useful with the display function. For example,

  • disp(['xxx' blanks(20) 'yyy'])

displays twenty blanks between the strings 'xxx' and 'yyy'.

disp(blanks(n)') moves the cursor down n lines.



blkdiag

Construct a block diagonal matrix from input arguments

Syntax

  • out = blkdiag(a,b,c,d,...)

Description

out = blkdiag(a,b,c,d,...) , where a, b, c, d, ... are matrices, outputs a block diagonal matrix of the form

The input matrices do not have to be square, nor do they have to be of equal size.

Note blkdiag works not only for matrices, but for any MATLAB objects that support horzcat and vertcat operations

box

Display axes border

Syntax

  • box on
    box off
    box
    box(axes_handle,...)

Description

box on displays the boundary of the current axes.

box off does not display the boundary of the current axes.

box toggles the visible state of the current axes' boundary.

box(axes_handle,...) uses the axes specified by axes_handle instead of the current axes.

Algorithm

The box function sets the axes Box property to on or off.



break

Terminate execution of a for loop or while loop

Syntax

  • break

Description

break terminates the execution of a for or while loop. Statements in the loop that appear after the break statement, are not executed.

In nested loops, break exits only from the loop in which it occurs. Control passes to the statement that follows the end of that loop.

Remarks

break is not defined outside of a for or while loop. Use return in this context instead.

Examples

The example below shows a while loop that reads the contents of the file fft.m into a MATLAB character array. A break statement is used to exit the while loop when the first empty line is encountered. The resulting character array contains the M-file help for the fft program.

  • fid = fopen('fft.m','r');
    s = '';
    while ~feof(fid)
    line = fgetl(fid);
    if isempty(line), break, end
    s = strvcat(s,line);
    end
    disp(s)

brighten

Brighten or darken colormap

Syntax

  • brighten(beta)
    brighten(h,beta)
    newmap = brighten(beta)
    newmap = brighten(cmap,beta)

Description

brighten increases or decreases the color intensities in a colormap. The modified colormap is brighter if 0 <> and darker if -1 <>.

brighten(beta) replaces the current colormap with a brighter or darker colormap of essentially the same colors. brighten(beta), followed by brighten(-beta), where beta <>, restores the original map.

brighten(h,beta) brightens all objects that are children of the figure having the handle h.

newmap = brighten(beta) returns a brighter or darker version of the current colormap without changing the display.

newmap = brighten(cmap,beta) returns a brighter or darker version of the colormap cmap without changing the display.

Examples

Brighten and then darken the current colormap:

  • beta = .5; brighten(beta);
    beta = --.5; brighten(beta);

Algorithm

The values in the colormap are raised to the power of gamma, where gamma is

brighten has no effect on graphics objects defined with true color.

No comments:

Post a Comment