newuser2007

hi
i wonder if i can call matlab using vb 2005!
and i wonder if i can plot using vb 2005!
if not please help me to choose suitable language


thank you



Re: Visual Basic Language How to PLOT = use SetPixel .

John Lieurance

My understanding of Matlab is that its a closed environment with its own compiler and tools. You can use VB .NET to work with Matlab, but only after you've created and exported a .NET compatable components. Aside from that you have to program Matlab in Matlab.

Here's a few links to get you started:

http://www.mathworks.com/products/netbuilder/

http://www.mathworks.com/company/events/seminars/seminar5896.html

http://www.mathworks.com/products/product_listing/index.html

Johnny





Re: Visual Basic Language How to PLOT = use SetPixel .

Spidermans_DarkSide - VSIP


Hi,

Use SetPixel instead of 'PLOT', here is an example on PictureBox1, so add a PictureBox to your project and 2 buttons for this to work. Just CUT & PASTE the code here.>>

Private Sub _

Button1_Click(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles Button1.Click

'Create a Bitmap of size 200 by 200 pixels.

Dim myBitMap As New Bitmap(200, 200)

'Create a 'PLOT' color ( colour ).

Dim myPlotColor As New Color

'Set the Color to white.

myPlotColor = Color.White

'Assign the IMAGE of PictureBox1 with the new BITMAP 'myBitMap'

PictureBox1.Image = myBitMap

' 'PLOT' using SetPixel to the COLOR created above.

myBitMap.SetPixel(50, 50, myPlotColor)

'Use GetPixel to retrieve the Pixel Color.

Dim gotColor As Color

gotColor = myBitMap.GetPixel(50, 50)

'Following shows a message equivalent to the COLOR

'construct of>>

myPlotColor = Color.FromArgb(255, 255, 255, 255)

'The first value above is the ALPHA or brightness value followed by the

'RED, GREEN and BLUE components of that 'COLOR' or shade.

MessageBox.Show("My pixel color at 50,50 is= " & gotColor.ToString)

'See http://www.w3schools.com/css/css_colornames.asp

'for what some of the 'built-in' colors look like.

'To assign a value like DodgerBlue

myPlotColor = Color.DodgerBlue

'or the 1E90FF is Hexadecimal as

myPlotColor = Color.FromArgb(&H1E90FF)

'See also http://www.w3schools.com/css/css_colorsfull.asp

'See also http://www.w3schools.com/css/css_colors.asp

End Sub

Private Sub _

Button2_Click(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles Button2.Click

'Set the PictureBox1 BackColor to DodgerBlue.

'Note the pixel still remains intact

'if you have clicked button1 first.

PictureBox1.BackColor = Color.DodgerBlue

End Sub


Regards,

S_DS






Re: Visual Basic Language How to PLOT = use SetPixel .

Spidermans_DarkSide - VSIP

Hi,

Use

Process.Start("MatLab.exe")

from within Visual Studio or an Express edition program / application to start the MatLab program from your PC if you have it installed locally on your PC.

Sorry but i don't know how you might call the PLOT function if PLOT is one of the MatLab functions.

Regards,

S_DS






Re: Visual Basic Language How to PLOT = use SetPixel .

Spidermans_DarkSide - VSIP

Hi,

Try this MatLab forum.>>

http://www.programmersheaven.com/mb/ctocplusplustomatlab/Board.aspx S=B20000

Regards,

S_DS