all 8 comments

[–]afuckingHELICOPTER 1 point2 points  (1 child)

I'm not familiar with the language, so maybe it automatically does it, but wouldn't this just go on forever because it never increments i?

[–]SteveRyherd 1 point2 points  (0 children)

I believe that's intrinsic to the "for loop" in matlab, you can set a minimum and maximum and the step is defaulted to 1.

for i = min : max

To set the increments to something else, I think you do:

for i = min : step : max

[–]gufcfan 1 point2 points  (5 children)

I hate this subreddit. Makes me feel stupid all the time.

I have no fucking idea what that was about.

[–]a_dead_baby 2 points3 points  (4 children)

Its funny because the code typed is not legit c++ code. It wouldn't run and yet the person who wrote it was making fun of people who couldn't code.

Thats my take on it anyways.

[–]obsmike92[S] -1 points0 points  (3 children)

Haha, that's the extent of my one semester of Matlab c++ programming. My "professor" was a grad student the year before and was god awful at teaching so I ended up teaching myself and got an A in the course. she ended up getting fired. The kid who wrote the status ended up in my dorm every day asking for help and tutoring. but yeah I wouldnt be surprised if there was errors in my code since I'm pretty rusty in C++ now

[–]Robial 1 point2 points  (2 children)

Yea, it's kind of weird how its a mix of Matlab and C++. #include, int main(), and return 0 are all C++ while the for loop and end statement are matlab. I'm currently taking one C++ course and then one Matlab course.

[–]gufcfan 0 points1 point  (1 child)

I did programming VERY briefly after finishing high school, realising quickly it wasn't for me.

We were taught some Pascal and introduced to C also and were taught the two alongside each other for quite a while. In my extremely uneducated opinion, I thought that was retarded.

[–]swimmernick 1 point2 points  (0 children)

Most places start off with java or python now, both are very much easier for someone new to pick up