Professional Documents
Culture Documents
Matlab Fundamental 16
Matlab Fundamental 16
There are two types of errors that you will see when you
program: syntax errors and run-time errors.
In this lesson, you will learn to use tools that help identify the
cause of syntax and run-time errors.
16.2 Code Analyzer: (1/5) Introduction
Introduction: Code Analyzer
You can call the function and fix these errors one at a time. A
better approach is to use the MATLAB Code Analyzer, which
identifies syntax errors in a script or function before you Undefined function or variable 'sortedv'.
execute code.
Error in getTopN (line 3)
topN = sortedv(1:N);
16.2 Code Analyzer: (2/5) Using Code Analyzer
Let’s look at the
function polyPrediction.
Does the code have any
errors?
endDuration = years(predictdate-dates(1));
usageFit = polyval(c,elapsedYears);
predictedusage = polyval(c,endDuration);