




| Blogs > clazziquai |
|
clazziquai
6685 Posts
![]() ![]() ![]() ![]() ![]() | ||
|
micronesia
United States24775 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 Britney Dota 2Mini ZZZero.O ggaemo firebathero Zeus 910 Rock NaDa IntoTheRainbow Heroes of the Storm Other Games FrodaN4745 Grubby3036 Liquid`RaSZi2236 singsing1794 fl0m1342 B2W.Neo703 mouzStarbuck353 KnowMe289 Hui .179 RotterdaM120 Fuzer UpATreeSC102 QueenE48 Organizations Other Games StarCraft 2 Other Games StarCraft 2 StarCraft: Brood War
StarCraft 2 • Hupsaiya StarCraft: Brood War• Reevou • Response • sooper7s • AfreecaTV YouTube • intothetv • Kozan • Migwel • IndyKCrew • LaughNgamezSOOP Dota 2 Other Games |
|
OSC
Universe Titan Cup
Rogue vs Percival
Wardi Open
Monday Night Weeklies
Replay Cast
Kung Fu Cup
GSL
herO vs Classic
Cure vs Clem
uThermal 2v2 Circuit
Replay Cast
GSL
Maru vs SHIN
Zoun vs Rogue
[ Show More ] WardiTV Spring Champion…
SKillous vs Strange
Lambo vs Strange
Ryung vs Strange
Lambo vs Ryung
Ryung vs SKillous
Lambo vs SKillous
Replay Cast
Maestros of the Game
Replay Cast
RSL Revival
TBD vs SHIN
TBD vs Rogue
IPSL
ZZZero vs WorsT
Julia vs eOnzErG
Replay Cast
RSL Revival
IPSL
Dragon vs Artosis
dxtr13 vs Hawk
BSL
|
|
|