




| Blogs > clazziquai |
|
clazziquai
6685 Posts
![]() ![]() ![]() ![]() ![]() | ||
|
micronesia
United States24753 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: Show nested quote + 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. The whole assignment is out of 1 point, so it's not that big of a deal :D | ||
| ||
StarCraft 2 StarCraft: Brood War Calm League of LegendsHorang2 firebathero Shuttle BeSt ggaemo Dewaltoss PianO JulyZerg Counter-Strike Heroes of the Storm Other Games Grubby3073 singsing2143 FrodaN2101 Beastyqt898 ceh9564 Hui .154 KnowMe147 RotterdaM132 Trikslyr65 QueenE63 Livibee6 Organizations
StarCraft 2 StarCraft: Brood War Dota 2 League of Legends Other Games |
|
Replay Cast
PiG Sty Festival
Maru vs Bunny
Classic vs SHIN
The PondCast
KCM Race Survival
WardiTV Winter Champion…
OSC
Replay Cast
PiG Sty Festival
Clem vs Percival
Zoun vs Solar
Escore
Epic.LAN
[ Show More ] Replay Cast
PiG Sty Festival
herO vs NightMare
Reynor vs Cure
CranKy Ducklings
Epic.LAN
Replay Cast
PiG Sty Festival
Serral vs YoungYakov
ByuN vs ShoWTimE
Sparkling Tuna Cup
Replay Cast
Replay Cast
Wardi Open
Monday Night Weeklies
Replay Cast
WardiTV Winter Champion…
WardiTV Winter Champion…
|
|
|