2011年11月26日
摘要: 编写简单脚本: you draw n random uniformly distributed numbers, where n is given on the command line, and compute the average of these numbers. the lesson learned from this little prctice can be concluded as... 阅读全文
posted @ 2011-11-26 21:13 bovine 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 什么是高斯消元法?请见维基百科的定义MATLAB实现:function x = gauss(a,b)n = length(b);for i = 1 : n-1 for j = (i+1) : n if a(i,i)~=0 lam = a(j,i)/a(i,i); a(j,(i+1):n) = a(j,(i+1):n) - lam*a(i,(i+1):n); b(j) = b(j) -lam*b(i); end endendfor i = n:-1:1 b(i) = (b(i) - sum(a(i,(i+1)... 阅读全文
posted @ 2011-11-26 18:07 bovine 阅读(5550) 评论(0) 推荐(0) 编辑
摘要: 作者:winterTTr (转载请注明) 我想,这个标题或许是很多初学者的问题。尤其是像我这样的对C/C++比较熟悉,刚刚进入python殿堂的朋友们 。C/C++的函数参数的传递方式根深蒂固的影响这我们的思维--引用?传值?究竟是那种呢。 呵呵,语言的特性决定了是使用的方法,那么,现在我们来探究一下python的函数参数传递方式。 在开始之前,我们有必要分清一下python的一些基础概念... 阅读全文
posted @ 2011-11-26 16:28 bovine 阅读(3449) 评论(2) 推荐(2) 编辑