佳礼资讯网

 找回密码
 注册

ADVERTISEMENT

搜索
查看: 1170|回复: 3

matlab

[复制链接]
发表于 22-10-2009 02:54 PM | 显示全部楼层 |阅读模式
有谁会用matlab软件solve problem吗??
回复

使用道具 举报


ADVERTISEMENT

发表于 22-10-2009 03:08 PM | 显示全部楼层
comsol ok 吗?
回复

使用道具 举报

 楼主| 发表于 22-10-2009 03:49 PM | 显示全部楼层
QUESTION 3



The Fibonaccinumbers 0, 1, 1, 2, 3, 5, 8, 13, 21 . . . are defined by


f1
= 0

f2
= 1

fk = fk−2
+ fk−1
for k≥3.


Matlab function, named as compute_last_fibonacci,which computes the Fibonacci numbers up to a given value n and returnsthe last element of these numbers. If n is a negative number thefunction should return -1 is given as follows.


function last =compute_last_fibonacci(n)
last = -1;
if (n>=0)

f = [ 0 1 ];


for k=3:n

f(k) = f(k-2) + f(k-1);


end

last = f(k);

end;


Executethe above function for five different
input values and display the result.

Answer: paste your matlab commands and outputs here.
回复

使用道具 举报

 楼主| 发表于 22-10-2009 03:52 PM | 显示全部楼层
需要solve这个问题..
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

 

所属分类: 欢乐校园


ADVERTISEMENT



ADVERTISEMENT



ADVERTISEMENT

ADVERTISEMENT


版权所有 © 1996-2026 Cari Internet Sdn Bhd (483575-W)|IPSERVERONE 提供云主机|广告刊登|关于我们|私隐权|免控|投诉|联络|脸书|佳礼资讯网

GMT+8, 31-3-2026 09:45 AM , Processed in 0.086619 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表