HERE
EDIT: On a slightly related note, if after 3 weeks of computational physics, including several lab sessions and a whole bunch of example codes that I let you download and study, you still can’t write a single line of working Matlab code, maybe this class isn’t for you. Oh, and that computer science minor that you’re planning on? Well, if you can’t figure out how to write a single line of Matlab code, maybe programming just isn’t for you. Yes, I’m well aware that CS majors don’t do many assignments in Matlab, but the basic concepts of handling arrays and creating loops and logical structures and functions that call other functions are all pretty universal. I’m just saying.
See that computer science major sitting next to you? When he makes a mistake it’s because he decided to streamline the calculation and while farming out different parts of the calculation to different functions he forgot that certain steps of the algorithm need to share some intermediate variables. That’s the sort of mistake that some of my students don’t even know enough to make. He gets an A just for making that mistake. You made a mistake because you haven’t figured out what a FOR loop is. You get an F just for making that mistake alone. Capisce?
Oh how I wish I could teach college. Or maybe not.
The whole things is HERE.
Scott