Use the Mathematica operation to control Excel-mathematica Link for Excel operations

Source: Internet
Author: User

Mathematica is the world's most famous mathematical software, and the ability to handle matrix list data is very powerful. If you can use Mathematica with Microsoft Excel, it will be significant.


You can interact with a computer with Mathematica installed, and then install a plugin called Mathematica Link for Excel 3.5.

Start Mathematica 8.0, create a new NB file, and enter the following code:


in[17]:= needs["Excellink"]


in[18]:= excelinstall[visible-True]


out[18]= linkobject["\" C:\\Documents and Settings\\All \

Users\\Application \

Data\\mathematica\\applications\\excellink\\binaries\\excellink.exe\ "\

", 97, 8]


in[19]:= m = {{3, 5, 7, 9}, {4, 6, 8, 12}};


in[20]:= excel["a1:d2"] = m


(* above, is the numeric value for writing Mathematica memory variables into Excel *)


in[46]:= r = excel["A1:a4"]


out[46]= {26., 91., 6., 23.}


in[51]:= p = r/total[r];

Piechart3d[r, Chartstyle, {Pink, Red, Green, Yellow},

Chartlabels, n[p*100, 3] "%", Chartlegends, Col]


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/7E/CB/wKiom1cItJTSWR-9AABP5xyzMhg813.gif "title=" Mlx.gif "alt=" Wkiom1citjtswr-9aabp5xyzmhg813.gif "/>

In the above code, line 17th, the function is to start link, line 18th, is Mathematica gets to the running Excel application.


Line 19th, create a two-dimensional list m, line 20th in the NB file, and send the value of M to the Excel cell range.


Line 46th, variable R to get the score data from the Excel worksheet, line 51st, Mathematica creates a pie chart based on the value of R.


This article is from the "Vba_expert" blog, make sure to keep this source http://ryueifu.blog.51cto.com/6673733/1762084

Using the Mathematica operations to control Excel-mathematica Link for Excel operations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.