Stuart’s MATLAB Videos

Watch and Learn

Catch errors early with simple visualizations

The sooner you find an error, the less expensive it is to find and fix. In MATLAB it is really easy to do quick visualizations of your data. When it is this easy, you should be doing these little reality check tests frequently.

In this video, we show how a user tried to make a random number distribution. The distribution was slightly biased. Just trying it a few times and staring at numbers in the command window does not show the bias. Running it a larger amount, and visualizing the results, makes the bias obvious. Catching the error immediately was easy just by looking at the plot of the data. Imagine how difficult it would be to find the small bias if this piece of code were inserted into a much larger simulation.

Test often.

|
  • print

댓글

댓글을 남기려면 링크 를 클릭하여 MathWorks 계정에 로그인하거나 계정을 새로 만드십시오.