raacampbell / shadedErrorBar

Produce elegant shaded error bars in MATLAB
GNU Lesser General Public License v3.0
174 stars 70 forks source link

A simple tweak to improve speed in Matlab #27

Open lrfbranco opened 4 months ago

lrfbranco commented 4 months ago

Hi there!

I noticed shadedErrorBar in a loop was rather slow. So I profiled it and it seems it can be easily improve if we don't check for MATLAB Ver all the time.

We can check if enviro is Matlab once and reuse that. Actually saves a couple seconds if running shadedErrorBar in a ~10 iter loop.

Hope this helps someone. First time contributing to someone else's repo.

LB