2010年12月1日星期三

字符串转数组

简单的说,就是一个这样的数组,在matlab里面怎么转成数组


a='1,2,3,424,232'

看起来挺简单一个事情,就连vba这种东西都有函数能简单的处理这个

结果我只想到了以下两个异常拙劣的方法.....

方案1:
eval(['c=[',a,']'])

方案2:

>> b=regexp(a, '(\d+)', 'tokens')

b =

    {1x1 cell}    {1x1 cell}    {1x1 cell}    {1x1 cell}    {1x1 cell}

>> str2double([b{:}])

ans =

     1     2     3   424   232


方案1实在过于不正规了,而且很担心eval这类东西的效率。

至于方案2,因为regexp得到的是一个cell类型,使得后续的处理变得很麻烦。为了把它转成数组,用了[b{:}]这样的方法,同样可能会很影响效率。另外str2double这个函数,也是从matlab的若干str2xxx函数里面好不容易选出来的------str2num就不支持cell输入,总的来说cell这个类型虽然解决了很多问题,提高了语言的灵活性,但是可能是出于效率的问题,matlab的基本函数对它的支持还是相对有限的。

结果去版上问了一下,大佬同志马上提供了下面这种方法,确实很不错

sscanf(strrep(a,',',' '),'%f')

sscanf这个函数是个非常好用的东西,因为他能直接以字符串作为输入,所以很适合做简单的parse-----跟regexp的有点在这里也表现得很突出:它可以直接返回数组。

2010年10月9日星期六

尾张同学又彪悍了

 http://www.math.ufl.edu/sastra-prize/


WEI ZHANG TO RECEIVE 2010 SASTRA RAMANUJAN PRIZE

The 2010 SASTRA Ramanujan Prize will be awarded to Wei Zhang, who is now a Benjamin Pierce Instructor at the Department of Mathematics, Harvard University, USA. This annual prize which was established in 2005, is for outstanding contributions by very young mathematicians to areas influenced by the genius Srinivasa Ramanujan. The age limit for the prize has been set at 32 because Ramanujan achieved so much in his brief life of 32 years. The $10,000 prize will be awarded at the International Conference on Number Theory and Automorphic Forms at SASTRA University in Kumbakonam, India (Ramanujan's hometown) on December 22, Ramanujan's birthday.

Dr. Wei Zhang has made far reaching contributions by himself and in collaboration with others to a broad range of areas in mathematics including number theory, automorphic forms, L-functions, trace formulas, representation theory and algebraic geometry. We highlight some of his path-breaking contributions: In 1997, Steve Kudla constructed a family of cycles on Shimura varieties and conjectured that their generating functions are actually Siegel modular forms. The proof of this conjecture for Kudla cycles of codimension 1 is a major theorem of the Fields Medalist Borcherds. In his PhD thesis, written under the direction of Professor Shou Wu Zhang at Columbia University, New York, Wei Zhang established conditionally, among other things, a generalization of the results of Borcherds to higher dimensions, and in that process essentially settled the Kudla conjecture. His thesis, written when he was just a second year graduate student, also extended earlier fundamental work of Hirzebruch-Zagier and of Gross-Kohnen-Zagier. The thesis opened up major lines of research and led to significant collaboration with Xinyi Yuan and his PhD advisor Shouwu Zhang. In the first of a series of joint papers (published in Compositio in 2009), the results of Wei Zhang's important thesis are generalized to totally real fields.

In a paper on heights of CM points in Shimura varieties, Wei Zhang along with Shou Wu Zhang and Xinyi Yuan establish an arithmetic analogue of a theorem of Waldspurger that connects integral periods to special values of L-functions. This paper which goes well beyond all earlier work on formulas of Gross-Zagier type will appear in the book series Annals of Mathematical Studies, Princeton.

Yet another outstanding contribution of Wei Zhang is conveyed in his two recent preprints - one on relative trace formulas and the Gross--Prasad conjecture and another on arithmetic fundamental lemmas. In these works he has made decisive progress on certain general conjectures related to the arithmetic intersection of Shimura varieties; in that process he has successfully transposed major techniques due to Jacquet and Rallis into an arithmetic intersection theory setting. With these two preprints and his seminal earlier work, Dr. Wei Zhang has emerged as a worldwide leader in his field.

Wei Zhang who hails from the People's Republic of China, was born on July 18, 1981. After obtaining a Bachelor's degree from Beijing University in 2004, he joined Columbia University to do his PhD. Even as a first year graduate student, while attending the NSF Focused Group Workshop at the University of Maryland in 2005, when he heard about the Kudla Conjecture, he started pursuing it. In just one year, he not only understood the conjecture, but also found an ingenious proof. Thus he shot to prominence very rapidly. After completing his PhD in 2009 at Columbia University under the supervision of Professor Shou Wu Zhang, he went to Harvard University where he was a Post-Doctoral Fellow in 2009-10, and currently holds the prestigious Benjamin Pierce Lectureship. At this very young age of 29, Dr. Zhang has made a profound influence in a wide range of areas in mathematics.

Wei Zhang was the unanimous choice of the SASTRA Ramanujan Prize Committee to receive the award this year. The international panel of experts who formed the 2010 Committee were: Chair - Krishnaswami Alladi (University of Florida), Dorian Goldfeld (Columbia University), Christian Krattenthaler (University of Vienna), Ken Ono (Emory University), Wolfgang Schmidt (University of Colorado), Jeffrey Vaaler (University of Texas, Austin), and Akshay Venkatesh (Stanford University).

Previous winners of the SASTRA Ramanujan Prize are Manjul Bhargava and Kannan Soundararajan in 2005 (two prizes), Terence Tao in 2006Ben Green in 2007Akshay Venkatesh in 2008, and Kathrin Bringmann in 2009. Thus Wei Zhang joins this impressive list of brilliant mathematicians who have made monumental contributions at a very young age.

Krishnaswami Alladi
Chair, 2010 SASTRA Ramanujan Prize Committee

2010年4月12日星期一

公司一堆人在看一个YouTube视频,上面是政府代表发言

我以为是出了什么大事件,赶紧凑过去看
结果是:


U.S. Representative: Guam May “Capsize”

By fitsnews • on April 2, 2010

hank johnson

By FITSNews || All we can say is thank God that U.S. Rep. Hank Johnson isn’t from South Carolina … although based on his grasp of , it wouldn’t surprise us to learn that he had been educated by our public school system.

Johnson – who actually represents Georgia’s Fourth District (DeKalb County) – is concerned about rising population levels on the Western Pacific island of Guam, which was established as an unincorporated U.S. territory in 1950.

“My fear is that uhhh, the whole island will, uhhh, become so overly-populated that it would tip over and, uhhhh, capsize,” Johnson said during an U.S. Armed Services Committee hearing last week.

Check out the 1:15 mark, people …

Wow.

Also, check out Admiral Robert F. Willard’s equally hilarious response … “we don’t anticipate that.”

A spokesman for Johnson later claimed that the Congressman wasn’t “suggesting that the island of Guam would literally tip over,” but was instead using a metaphor for an environmental “tipping point” that would be reached if the U.S. sends 8,000 Marines to the island.

Mmmm-hmmm.

Clearly, semi-literate Florida Congresswoman Corrine Brown needs to step it up (or step it down, in this case) if she wants to retain her “Dumbest Lawmaker in America” crown …


2010年3月29日星期一

Matlab下面调用其他程序

直接用system或者!就可以了

但是今天遇到的问题是这样的

有个程序运行到最后会出现”Please press any key to finish”

这就比较郁闷了,matlab会死在这个地方等输入,完成自动化的目的就泡汤了

研究了一下发现两个办法:

1.直接在shell里面用管道传一个东西进去:
!echo 1|SQL2CSV
2.用matlab的WScript.Shell COM方式调用外部程序,并且用他来传送输入:

h=actxserver('WScript.Shell');
h.Run('SQLtoCSV.exe');
pause(10);
h.AppActivate('SQLtoCSV.exe');h.SendKeys('~');

後一个方法这里看貌似土了一点,不过以后兴许别的地方用的上

参考:
http://www.mathworks.com/support/solutions/en/data/1-33DJ6K/index.html?product=ML&solution=1-33DJ6K

2010年3月4日星期四

遏制房价!


http://att.newsmth.net/att.php?p.872.76101.378.jpg