Graphics Programs Reference
In-Depth Information
Here the vertical bar highlights the place where MATLAB believes the error
is located. In this case, the actual error is earlier in the input line.
Spelling Error
Using uppercase instead of lowercase letters in MATLAB commands, or
misspelling the command.
CAUSE:
SOLUTION: Fix the spelling.
Forexample,theUNIXversionof MATLABdoesnotrecognize Fzero or FZERO
(in spite of the convention that the help lines in MATLAB's M-files always
refer to capitalized function names); the correct command is fzero .
EXAMPLE:
>> Fzero(inline('xˆ2 - 3'), 1)
??? Undefined function or variable , Fzero , .
>> FZERO(inline('xˆ2 - 3'), 1)
??? Undefined function or variable , FZERO , .
>> text = help('fzero'); text(1:38)
ans =
FZERO Scalar nonlinear zero finding.
>> fzero(inline('xˆ2 - 3'), 1)
ans =
1.7321
Error Messages When Plotting
There are several possible explanations, but usually the problem is the wrong
type of input for the plotting command chosen.
CAUSE:
SOLUTION: Carefully follow the examples in the help lines of the plotting command,
and pay attention to the error messages.
EXAMPLE:
>> [X,Y] = meshgrid(-1:.1:1, -1:.1:1);
>> mesh(X, Y, sqrt(1 - X.ˆ2 - Y.ˆ2))
??? Error using ==> surface
X, Y, Z, and C cannot be complex.
Search WWH ::




Custom Search