It doesn't. It uses full double-precision floating point numbers to
calculate everything. By default it only prints a few decimal places
to the screen. You can change this using the command format long.
Type help format for more information.
When performing linear algebra operations on complex matrices, it is
almost always the complex conjugate transpose (also called the Hermitian
transpose) that is needed (see Gilbert Strang's linear algebra book for
discussion- page 293 in edition 3). The bare apostrophe is an operator
that takes the complex conjugate transpose. The non-conjugating
transpose operator is a period followed by an apostrophe. Type
help punct for more info.
>> A' % complex conjugate transpose >> A.' % transpose
NaN's are tricky. NaN==NaN is false, so you can't say
x(x==NaN) = 0;
Instead, use the function isnan, as in:
x(isnan(x)) = 0;
Bob Gilmore writes:
In R12 (MATLAB 6.0), this can be controlled via a preference. Select the
File | Preferences...menu item, and selectCommand Windowin the Preferences dialog that appears. In theDisplaysection, there's a checkbox labeledLimit matrix display width to eighty columns.Unchecking that box allows matrix displays to make full use of the Command Window's width. [Unchecked is the default.]
Starting with MATLAB R12.1, users can access the current command window
size using the root property CommandWindowSize. That is,
sz=get(0, 'CommandWindowSize'). In R12.0, there is no way to do
this unless you call undocumented C functions from a MEX file.
The built-in editor in MATLAB 6.0 now has a block-comment feature. Or you can use matlab-mode for Emacs, which supports this as well.
If you are using an older version, use this:
if 0 commented out code end
This is not the best solution, since parse errors inside that block will cause an error. But it's better than sticking comment characters in from of every line.
The key is to create a STARTUP.M file. Look at the online help for more detailed instructions specific to your operating system.
You can use the following one-line function to determine the indices of the local maxima.
function index = localmax(x) index = find( diff( sign( diff([0; x(:); 0]) ) ) < 0 );
You might have overwritten the variable i with a number earlier in your program (or session, for that matter). You can reset i using i=sqrt(-1), or "clear i", or you can use j, or you can use the function "complex".
Steve Lord tells me that an even better solution is to use 6i, which is unambiguously 6*sqrt(-1). In MATLAB versions >= 6.5, this can change a function which does not accelerate to one which does. For more details read http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_prog/ch7_per7.shtml.
Easiest solution: use the PATHTOOL GUI. Or if you want command line access:
Suggested by Joshua Stiff:
You can use addpath to add directories from the command line,
and path2rc to write the current path back to
`pathdef.m'. If you do not have write permissions for
`pathdef.m', path2rc can write to a different file, which
you can execute from your `startup.m'.
Go to the first, previous, next, last section, table of contents.