题目
mathlab数学实验题编程判断函数f(x)=(x-1)/(x+1) 的迭代序列是否收敛.
提问时间:2021-03-23
答案
count = 0;
flag1 = 0;
flag2 = 0;
x = 2;
while(1)
y = x+1;
if ((x-1)/(x+1) == (y-1)/(y+1))
count = count + 1;
end
if((count = 0) & ((x-1)/(x+1) = (y-1)/(y+1)))
count = 0;
end
if(count == 5)
flag1 = 1;
break;
end
x = x*2;
end
x = -2;
while(1)
y = x-1;
if ((x-1)/(x+1) == (y-1)/(y+1))
count = count +1;
end
if((count = 0) & ((x-1)/(x+1) = (y-1)/(y+1)))
count = 0;
end
if(count == 10)
flag2 = 1;
break;
end
x = x*2;
end
最后在看一下flag1和flag2的值,如果为1,则说明收敛!(前者表示像正无穷方向收敛,后者像负无穷方向)
flag1 = 0;
flag2 = 0;
x = 2;
while(1)
y = x+1;
if ((x-1)/(x+1) == (y-1)/(y+1))
count = count + 1;
end
if((count = 0) & ((x-1)/(x+1) = (y-1)/(y+1)))
count = 0;
end
if(count == 5)
flag1 = 1;
break;
end
x = x*2;
end
x = -2;
while(1)
y = x-1;
if ((x-1)/(x+1) == (y-1)/(y+1))
count = count +1;
end
if((count = 0) & ((x-1)/(x+1) = (y-1)/(y+1)))
count = 0;
end
if(count == 10)
flag2 = 1;
break;
end
x = x*2;
end
最后在看一下flag1和flag2的值,如果为1,则说明收敛!(前者表示像正无穷方向收敛,后者像负无穷方向)
举一反三
已知函数f(x)=x,g(x)=alnx,a∈R.若曲线y=f(x)与曲线y=g(x)相交,且在交点处有相同的切线,求a的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
最新试题
- 1人教版五年级下册数学新课标26面智慧乐园答案
- 2数列极限的问题不懂
- 3如果在7个连续奇数中,第二个数与第六个数的和是为38,那么第5个数等于_.
- 4质量为M的小球用长度为L的轻绳系住,在竖直平面内做圆周运动,运动过程中小球受到空气阻力作用,已知小球经过最低点时轻绳受到的拉力为7mg,经过半周小球恰好能通过最高点,则此过程中小球克服空气阻力做功多少
- 51.在平面直角坐标系,已知点A(0,-2)和点B(-4,5),在Y轴上求一点C,使三角形ABC的面积等于6.求C.
- 6(2—1/65)×13怎么简便运算?要向下算 反正就是托式计算
- 7you belong with me 和 you belong to me 具体两句话的区别在哪?表达的意思有什么不同
- 8基数词1,2,3,4,5,6,7,9,10,12,20,21,23,24怎么写
- 9集合的题.谁帮我解开一下.已知集合A={-1,3,2m-1}.集合B={3M²}B包含A则实数m=
- 10用所给词的适当形式填空. I’m sure there (be) robots in our homes in the future.
热门考点
- 1小明在纸上画了一条平行线._.(判断对错)
- 2等腰梯形的中位线和腰长相等且周长为24,求上底长
- 3unit 3 animals怎么读
- 4演绎:的近义词
- 5The problem is that l spend so much time____my homework that l cannot find any time___my hobbies
- 6who ______(plan) to go there?Tom is.
- 7would like to get to know you...thx!
- 8x+y=41 x-4y=16 x,y分别是多少
- 9the boy jumps high改为感叹句!
- 10雨霖铃-中直接抒情的语句是哪一句 ,有和作用?