473,320 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Using Mathematica to plot in Visual Studio

Hello

I am using Visual Studio 2005 beta and Mathematica 5.0.
I was trying to make an application (in c#) which would allow me to use
Mathematica functions like Plot[], ListPlot[] etc and show the
resulting plot in a picturebox in the form.

I read the .NETLink API and tried to run the sample code:

private void computeButton_Click(object sender, System.EventArgs e)
{
if (mathKernel.IsComputing) { mathKernel.Abort();}
else {
computation.resultBox.Text = "";
messagesBox.Text = "";
printBox.Text = "";
graphicsBox.Image = null;
computeButton.Text = "Abort";

mathKernel.Compute(inputBox.Text);
computeButton.Text = "Compute";

// Populate the various boxes with results.
resultBox.Text = (string) mathKernel.Result;
foreach (string msg in mathKernel.Messages)
messagesBox.Text += (msg + "\r\n");
foreach (string p in mathKernel.PrintOutput)
printBox.Text += p;
if (mathKernel.Graphics.Length > 0)
graphicsBox.Image = mathKernel.Graphics[0];
}
}
But when I run this application and press the compute button, a window
opens up which says "Choose a MathLink program to launch" and asks me
to select an exe file.
I have no idea what is happening.

Could someone please guide me on what to do.

Thanks in advance.

Siddharth Jain

Nov 17 '05 #1
1 5196
Hello,

This is just a wild guess, but probably you are not running the
mathematica kernel, which is needed to perform the calculations. That
might be the reason why the dialog box asks you to choose a "MathLink
program". Try chooseing the Mathematica Kernel .exe (if such thing exists).

Siddharth Jain wrote:
Hello

I am using Visual Studio 2005 beta and Mathematica 5.0.
I was trying to make an application (in c#) which would allow me to use
Mathematica functions like Plot[], ListPlot[] etc and show the
resulting plot in a picturebox in the form.

I read the .NETLink API and tried to run the sample code:

private void computeButton_Click(object sender, System.EventArgs e)
{
if (mathKernel.IsComputing) { mathKernel.Abort();}
else {
computation.resultBox.Text = "";
messagesBox.Text = "";
printBox.Text = "";
graphicsBox.Image = null;
computeButton.Text = "Abort";

mathKernel.Compute(inputBox.Text);
computeButton.Text = "Compute";

// Populate the various boxes with results.
resultBox.Text = (string) mathKernel.Result;
foreach (string msg in mathKernel.Messages)
messagesBox.Text += (msg + "\r\n");
foreach (string p in mathKernel.PrintOutput)
printBox.Text += p;
if (mathKernel.Graphics.Length > 0)
graphicsBox.Image = mathKernel.Graphics[0];
}
}
But when I run this application and press the compute button, a window
opens up which says "Choose a MathLink program to launch" and asks me
to select an exe file.
I have no idea what is happening.

Could someone please guide me on what to do.

Thanks in advance.

Siddharth Jain

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Madhusudan Singh | last post by:
Hi I am relatively new to Python. I am using Qt Designer to create a UI for a measurement application that I use. Everything seems to be clear but the use of globals (defined in the module...
3
by: Andrew Luke | last post by:
Hi all you C++ guru's! I'm 'very, very' new to C++ and I'm having a little trouble configuring my VS environment I think - when I try and compile some sample code I'm getting the following...
13
by: kamaraj80 | last post by:
Hi I am using the std:: map as following. typedef struct _SeatRowCols { long nSeatRow; unsigned char ucSeatLetter; }SeatRowCols; typedef struct _NetData
0
by: vishal.nagota | last post by:
I'm making a project on vc++ express I want to plot graphs, so using MSChart evrything goes fine, till i come to point where I've to include afxdisp.h by defualt i'm using Project properties...
1
by: ligong.yang | last post by:
Hi all, I got tortured by a very weird problem when I was using k. wilder's random generator class in my program. PS: wilder's generator class can be found at...
0
by: ashswin | last post by:
I'm trying to create a program using Visual Studios C# to create an excel file and plot the data on a chart. I already know how to make the excel chart and insert data into cells, but can someone...
0
by: wankhusairi | last post by:
hallo sir .. i am still new on using vb and i have tried to load an excel using a visual basic interface.. but if i wanted to plot my excel data what should i do.. must i cahnge my program on loading...
2
by: itdevries | last post by:
Hi, I've been looking for a basic c++ 2D plot library to use with windows (and visual studio). I was a bit overwhelmed by all the options I found. Can someone here recommend a basic 2D plot...
1
by: Piotrekk | last post by:
Hi I have a strange problem. Here is some input data before I describe the problem. 1. RemoteClass (Mathematica) is compiled into dll and put to GAC 2. Server remoting configuration is done by...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.