MATLAB experts needed
Blogs > clazziquai |
clazziquai
6685 Posts
| ||
micronesia
United States24483 Posts
2: x=0 counter=0 While (x<.8 and x>.85) { <x=rand(1)> If x>.8 or x<.85 then counter++ } Report I don't know the exact syntax, but something like that? edit: for 2 be careful of if they are considering .8 and .85 as valid answers or not (inclusive or exclusive conditions?) | ||
Darth_Ihsahn
Mexico138 Posts
Isn't necessary (Actually it's wrong). Just counter++ | ||
overpool
United States191 Posts
On October 27 2008 11:25 micronesia wrote: 1: The outer loop cycles through each of the members of the matrix. The inner loop compares the member highlighted currently by the outer loop in each direction, with the condition that it only does it if the direction is on the matrix (like you can't look up from the top row). Good answer, but it's easier to just choose two arbitrary directions to compare in (like right and down), and then only test (length-1) rows and (height-1) columns. (Note: I've never used MATLAB so I'm making assumptions about its capabilities.) | ||
JDPingpong
United States57 Posts
*edit* The | symbol in the while statement means or. | ||
clazziquai
6685 Posts
How about #1 anyone? That one is still weird I can't get anything to work -_- | ||
clazziquai
6685 Posts
| ||
JDPingpong
United States57 Posts
*edit* This is a great problem when starting out with MATLAB. It teaches you how to index stuff. When doing the for loop, you need to store each value of the tuition into cell of a matrix. I don't have much time to explain, i'm on class break, but take a look over it and see if you can get comfortable with the indexing in the for loop. Its a skill you have to have when using MATLAB. If you are confused anywhere, just ask. I'll check this thread. As for problem 1 in the OP, i'll take a look at it later tonight. It'll take a little more time to figure out, but i think i can help. | ||
Chromyne
Canada561 Posts
On October 27 2008 11:19 clazziquai wrote: Ok so I basically finished the problem set with the exception of the last two questions, aka the hardest ones TT That's unfortunate, I would have helped but I had to do a pre-lab and study for a midterm. Hope it' doesn't mar your grade too much. | ||
Raithed
China7078 Posts
| ||
clazziquai
6685 Posts
On October 28 2008 03:42 Chromyne wrote: That's unfortunate, I would have helped but I had to do a pre-lab and study for a midterm. Hope it' doesn't mar your grade too much. The whole assignment is out of 1 point, so it's not that big of a deal :D | ||
| ||