[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 76 KB, 1199x699, fibonacci.jpg [View same] [iqdb] [saucenao] [google]
9237485 No.9237485[DELETED]  [Reply] [Original]

Can anybody please save my ass?
I need to hand in this excercise but I don't get how to apply these while loops properly.

>> No.9237491

give me a minute

>> No.9237500

>>9237485
while tobefair
you have to have a very high IQ to understand Rick and Morty. The humour is extremely subtle, and without a solid grasp of theoretical physics most of the jokes will go over a typical viewer’s head. There’s also Rick’s nihilistic outlook, which is deftly woven into his characterisation- his personal philosophy draws heavily from Narodnaya Volya literature, for instance. The fans understand this stuff; they have the intellectual capacity to truly appreciate the depths of these jokes, to realise that they’re not just funny- they say something deep about LIFE. As a consequence people who dislike Rick & Morty truly ARE idiots- of course they wouldn’t appreciate, for instance, the humour in Rick’s existential catchphrase “Wubba Lubba Dub Dub,” which itself is a cryptic reference to Turgenev’s Russian epic Fathers and Sons. I’m smirking right now just imagining one of those addlepated simpletons scratching their heads in confusion as Dan Harmon’s genius wit unfolds itself on their television screens. What fools.. how I pity them.

And yes, by the way, i DO have a Rick & Morty tattoo. And no, you cannot see it. It’s for the ladies’ eyes only- and even then they have to demonstrate that they’re within 5 IQ points of my own (preferably lower) beforehand. Nothin personnel kid
end

>> No.9237501

>>9237500
xDDD

>> No.9237515

>>9237491
I'll wait all night

>> No.9237519
File: 15 KB, 86x94, hmmm.png [View same] [iqdb] [saucenao] [google]
9237519

function[value] = fibonacciValue(m)
%Note: m should be integers greater than or equal to 1.

value = [1 1];
i=2;
while value(i) < m


value(i+1) = value(i)+value(i-1);
i= i+1;

end

if value(end) > m
value = value(1:end-1);
end
end


I haven't really tested this yet but it should work

>> No.9237524

>>9237519
holy crap, you actually did it, thanks tons!
you're awesome!

>> No.9237527

>>9237524
you better explain to me (or at least try) why this works, or I won't help any anons again.

>> No.9237558

>>9237527
I'm an untalented Matlab noob but I'll try.
function[value] = fibonacciValue(m)
%Note: m should be integers greater than or equal to 1.

value = [1 1];
i=2;
%starting values
while value(i) < m
%loop that is repeated until condition is met

value(i+1) = value(i)+value(i-1);
i= i+1;
%fibonacci series
end

if value(end) > m
value = value(1:end-1);
%we need the fibonacci element which is smaller than m
end
end

>> No.9237564

>>9237558
First of all, don't say "noob". second: can you tell me what the line value = value(1:end-1) does?
Overall not a bad explanation.

Maybe you'll help out another anon some time

>> No.9237572

>>9237564
>First of all, don't say "noob"
lol why

>> No.9237573

>>9237572
before i answer that, what major are you OP?

>> No.9237574

>>9237573
I am not OP. But I am a math major.

>> No.9237576

>>9237564
end-1 is the second to the last element of the series. we're cutting off the last element it is larger than m and obtain the series which is asked for.

>> No.9237578

>>9237574
good for you. using noob makes me think you're a highschooler, and im not helping out any highschoolers

>> No.9237580

>>9237573
economics. why?

>> No.9237581
File: 62 KB, 182x218, Screen Shot 2016-11-18 at 3.03.33 PM.png [View same] [iqdb] [saucenao] [google]
9237581

>>9237576
sounds good.

guess that means this thread is dead unless some one else has a matlab question i might answer

>> No.9237584

>>9237580
>econ
ugh.
i just was hoping i wasnt helping an engineering major

>> No.9237592

>>9237584
why is that? and is that you on the picture?

>> No.9237593

>>9237584
I'm a physicsfag and I don't really get the meme about engineers here. Got a few friends doing electrical and compuer eng and they're cool dudes.

>> No.9237598

>>9237485
>for loop

lel

function fib = fibonacciValue(m)
i=1:m;
phi=(sqrt(5)+1)/2;
return fib = round(phi.^i ./ sqrt(5));

>> No.9237606

>>9237593
I wish I would have picked some natural (real) science major too. I'd love to get to know the real world, not just something some people just have made up.
Since I live in Switzerland there are still some decent banking etc. jobs for a mecon though, the only thing that keeps me going.

>> No.9237612

>>9237564
cease your fucking autism