How to write data from Matlab to Excel (especially when you don't have Excel)

If you are using Matlab on a MS-Windows PC with MS-Excel installed, there is no problem reading and writing data to Excel (in case your users/customers only understand this software but you still want to do the computations in Matlab). Here is the code to read (1st line) and write (2nd line): [sourcecode language=“matlab”] inputs = xlsread(‘inputfile.xls’, ‘inData’, ‘A1:B3’); [writeStatus, writeMsg] = xlswrite(‘outputfile.xls’, myMatrix, ‘outData’, ‘A1’); [/sourcecode] Now, there are several reasons why you may not be able to read and write directly to an Excel file: you have Matlab but ...

December 11, 2012 · 3 min · jepoirrier

Pi in Pubmed

On March 14th, 2012 (3/14/2012), it was Pi day. According to Wikipedia, Pi (π) is a mathematical constant that is the ratio of any Euclidean circle’s circumference to its diameter. While others estimated π using Monte Carlo in R or declared π is wrong, I tried to see how many times the pi value is cited in Pubmed, a database of references and abstracts on life sciences and biomedical topics. And here are the results (please note the log y-axis): ...

March 19, 2012 · 1 min · jepoirrier