Catch errors early with simple visualizations
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.
评论
要发表评论,请点击 此处 登录到您的 MathWorks 帐户或创建一个新帐户。