Matlab 👩‍💻 Debugging

Publié le: 01 juillet 2020
sur la chaîne: APMonitor.com
1,408
14

One of the biggest time consuming parts of programming is debugging, or resolving mistakes in the program. This is true for every language because the computer needs exact commands, which is very important for precise measurements and control for incubating. A few steps can limit the time you are searching for mistakes, instead of completing the project.

Steps for effective programming

Start with understanding the big picture. When you map out the entire program, you can see parts of the code that can be developed and tested separately. Do this in whichever way suits you best, we’ll leave it up to you. For the egg incubator, it would be understanding what you actually need to do to help an egg hatch.

Start by outlining your code, writing high-level instructions (pseudo-code) what you want each section of the code to do. Break it into more specific tasks. You can do this even without understanding the basics of Python. Once you learn Python basics, you can translate these high level instructions into code. Organizing the outline helps to make sure your programming isn't more complex than it needs to be.

Program the specific tasks and connect them together. Direct tasks make it significantly easier to program because the program is modular. It’s a lot harder to program something if the program is large and complex. For the incubator, this may be programming something specific like how hard the heater should work, based on a low temperature reading.

Test and fix problems. This is basically debugging, but don’t only test the whole project all in one go. It’s much easier to find a problem if you test every once in a while, when you are programming smaller parts. A good way to do this is grab a specific piece of code, run it on a seperate file, and see if it does the job you want. An example would be fixing when the heater should stop working, so the egg doesn't go over temperature.


The better you follow these steps the less time you will have to spend fixing problems in your code for your incubator or just Matlab programs in general.


Course Overview: https://apmonitor.github.io/begin_mat...
Source Files on GitHub: https://github.com/APMonitor/begin_ma...
TCLab: https://apmonitor.com/heat.htm
Additional Online Courses: https://apmonitor.com/che263/index.ph...


Sur cette page du site, vous pouvez voir la vidéo en ligne Matlab 👩‍💻 Debugging durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur APMonitor.com 01 juillet 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 1,408 fois et il a aimé 14 téléspectateurs. Bon visionnage!