MATLAB / Computer Programming Help

<p>So, I just got my first midterm back for my MATLAB / computer programming class. Lets just say I did absolutely horrible. I am not very good with this stuff. I am doing good in all my engineering classes, but for some reason I find computer programming especially challenging. </p>

<p>I was one of two people who got a 60 out of 60 on the engineering dynamics midterm this semester, also got a 40 out of 40 on my circuits I midterm, but I got a 58 out of 100 (class average was a 60) on this MATLAB midterm.</p>

<p>I think my main problem is the exams do not reflect the homework. The homework assignments are real applied problems, where we have to sit down at a computer and write test and debug a program to perform some task (one of them was to calculate the income tax based on some specified range of income).</p>

<p>The exams however are a pencil and paper type deal in a lecture hall. This exam involved re-writing a "switch statement" set of code that was logically equivalenet to an "if statement" code, analyzing an if code to determine the output, and then finally write a program to compute prime numbers (no we couldn't use MATLAB's built in isprime function).</p>

<p>So my main question is: </p>

<p>Does anybody know where I can find sample problems that are similar to my exams?</p>

<p>I need to do more problems like that since they are what I will be tested on in the final, and I really need to pass this class.</p>

<p>Help me out!</p>

<p>You got 2 points under the average. Take a step back from the ledge, my friend. I don’t think you really can practice too much for those kinds of tests. Either you know the code or you don’t. The more you program, the more used to it you will get. The good news is, your future as an engineer does not depend on doing well on these tests. In the future, any time you need to code you will be allowed to go to as many websites and read whatever manuals you want, as much as you want, so don’t sweat it so much.</p>

<p>I would recommend just practicing programming. If you have the time I would pick up a language like Python or Java and just start programming simple applications following tutorials online.
I obviously did not take the exam, but rewriting switch statements, and determining function outputs are really basic programming skills (to me, IMHO) and its a skill set I have gained from years of practice (although I had the first bit down in a couple of weeks).</p>

<p>My experience in my AP CS class has shown me that when you learn programming from a teacher most students just copy what the teacher wrote without really understanding it. If you can recognize that “I only eat green apples. I see apple, write a computer program to decide if I will eat the apple” can be easily done with a switch statement (hypothetically) without copying and pasting if statements, you really understand why you are using a switch an what it does.</p>

<p>I hope I am still making some sense here. I think I have gone off on a tangent, but my main point is: write a small program in any language to try and get a feel of what computers are capable of. The language is not that hard, and fundamentally all languages are really the same. I feel its just understanding how to “think” like a computer.</p>

<p>lol if I had to take a class in MATLAB I’d almost want to fail it. The best part about MATLAB is that it’s not Maple… and Maple’s only redeeming quality is I don’t (usually) have to use it.</p>

<p>does your class have an assigned textbook? I bought a couple for the matlab class I took and the material on your exam is exactly the kind of material the texts cover. my class was similar that the hw was created by the professor and was actually much different from our readings.</p>

<p>@boneh3ad</p>

<p>You’re right, I did only get two points below the average. I guess I should just take solace in knowing that my grades aren’t the other way around, at least I am acing my engineering classes, which are much more important than a class on computing.</p>

<hr>

<p>@ RewindYouLostMe</p>

<p>Determining function outputs should be easy, but when you have to determine a function out put of </p>

<p>if (this) & (~(this | this) & this)</p>

<p>where this is similar to something like -2*(-b) - d</p>

<p>it is a pain in the ass and I made some stupid mistakes. The program had I think three or four if statements similar to that. The converting switch statements I got mostly right except I didn’t use the two equal signs. The prime numbers problem I only got half credit for, which I honestly think is more than I deserve, but I am not going to complain about that.</p>

<hr>

<p>@whoswithwhatnow</p>

<p>The textbook we use is MATLAB Programming For Engineers by Steven Chapman. Can you tell me what some of the books you used that had homework problems similar to my exam problems?</p>

<p>[Amazon.com:</a> Essential Matlab for Engineers and Scientists, Fourth Edition (9780123748836): Brian Hahn, Dan Valentine: Books](<a href=“http://www.amazon.com/Essential-Matlab-Engineers-Scientists-Fourth/dp/0123748836/ref=sr_1_12?ie=UTF8&s=books&qid=1269622234&sr=8-12]Amazon.com:”>http://www.amazon.com/Essential-Matlab-Engineers-Scientists-Fourth/dp/0123748836/ref=sr_1_12?ie=UTF8&s=books&qid=1269622234&sr=8-12)</p>

<p>Not to hijack the thread here but how often is MATLAB used in the real world? I have an entire class based off of learning MATLAB but it seems kind of useless.</p>

<p>it can serve a python-ish role if you know it well. it will never be the language of choice for production-code but it is great for prototyping/test work. python has similar features, but its free :). the reason academia uses matlab so much is the mathworks’ business model. they give good prices to academia and students to get them “hooked” so they will go on to industries and request expensive matlab licenses.</p>

<p>matlab is quite easy to program in, believe me. I would recommend you check out a matlab book from your library and go through it. it becomes easier with practicing.</p>

<p>Programming is kind of like economics. You could either spend all day memorizing all these little formulas and rules for what each and everything does, and probably not be able to get every detail, or you could learn how to derive the answer by logic, and that can only happen if you understand exactly how everything works. The latter is much easier, so definitely (as someone else also mentioned) try to learn concepts, it gets much easier that way.</p>

<p>try to understand the code dude, and it will be easy…i had programming classes in my high school and it’s remarkably good in my country, 10th grader will be taught C++, 11th get HTML and JavaScript, and now PHP and CSS, try learn C++, it’s simple yet fundamental</p>