Learning Objectives Learn how to write correct and reliable Matlab code Learn how to debug Matlab code. ME 2016: Computing Techniques. Designing and Debugging Matlab Code Understand The Matlab graphical Debugger Defensive coding practice Error trapping. How to Design a Program?.
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Learning Objectives
Learn how to write correct and reliable Matlab code
Learn how to debug Matlab code
ME 2016: Computing Techniques
Clear all breakpoints
Insert Breakpoint
Step
Step Out
Exit debug mode
PotentialBreakpoints
Step In
Continue
Breakpoint
Warning: the code above contains bugs!
if gear_ratio == 0
error('The gear_ratio should be non-zero.');
end
gear_ratio = 0; % for illustration purposes only…
try
load_torque = load_torque (rpm, gear_ratio, slope);
disp(torque);
catch
fprintf('Something went wrong while computing the load torque');
load_torque = 0;
end