File Exchange Pick of the Week

Our best user submissions

Emulating a physical experiment of measuring M&M’s

Jiro's Pick this week is M&M statistics by Lisa R. Thompson.

A common challenge I hear from educators is how to conduct courses that involve experiments or some sort of hardware interactions during this pandemic. If students are not able to be present in the classroom where the instruments are then you may need to become creative in how you teach. We have nice page that summarizes various solutions for your virtual labs, and there's also a blog post on Loren's Blog about moving your lab-based classes online. I won't repeat the information in those pages, but here are a few approaches to replacing hardware-based courses.

  • Replacing physical experiments with simulations
  • Incorporating low-cost hardware, such as Arduinos or mobile phones to have students do experiments at home
  • Remotely accessing and controlling hardware that's on campus

This entry by Lisa is an app that emulates a real experiment. It lets students "investigate the statistics of random normal sampling using M&M candies." I'm impressed with the level of detail that this app has with respect to a real experiment.

  • You can choose from 4 different scales, each having different readabilities (resolution)
  • The M&M samples (color and mass) are drawn from a distribution based on a real bag of M&Ms
  • Repeated measure noise is taken into account for each scale, taken from actual data or equipment specs
  • Idle random noise is added to emulate the jitter. I must admit, I had kick out of this, when I saw the scale reading change from time to time. Lisa uses a timer object to add the random noise every several seconds.
  • Measurements can be recorded in output to an Excel file


Give it a try and let us know what you think here or leave a comment for Lisa.

Also, if you have other examples of virtual experiments, please tell us about it here at our Distance Learning Community.

Published with MATLAB® R2020b

  • print
  • send email


To leave a comment, please click here to sign in to your MathWorks Account or create a new one.