title: Using MATLAB functions in vb.net
body: <p>I'm new to VB.net but I have to do this for our project. I made a very simple program to call the matlab functions that I made in vb.net. This program is simple, it will just determine the width and the height of the image in the picturebox.</p>
  
  <p>Here's my matlab code and compiled it using the .NET Assembly to export a .dll files:</p>
  
  <pre><code>function [width, height, third] = imageInfo(input)
  inImage = imread(input);
  [width, height, third] = size(inImage);
  end
  </code></pre>
  
  <p>Here's the GUI of my program:</p>
  
  <p><img src="https://i.stack.imgur.com/bIZ2n.jpg" alt="enter image description here"></p>
  
  <p>And here's the vb code that I made:</p>
  
  <pre><code>Imports MathWorks.MATLAB.NET.Arrays
  Imports MathWorks.MATLAB.NET.Utility
  Imports imageInfo
  
  Public Class Form1
      Public myImageInfo As New imageInfoClass
  
      Dim imageWidth As String
      Dim imageHeight As String
      Dim result As New MWNumericArray
      Dim imagePath As String
  
      Private Sub btnBrowse_Click(sender As Object, e As EventArgs) Handles btnBrowse.Click
          If ofdSelectPicture.ShowDialog = DialogResult.OK Then
              pbImage.Image = Image.FromFile(ofdSelectPicture.FileName)
              imagePath = "'" &amp; ofdSelectPicture.FileName &amp; "'"
          End If
      End Sub
  
      Private Sub btnProcess_Click(sender As Object, e As EventArgs) Handles btnProcess.Click
          result = myImageInfo.imageInfo(imagePath)
          tbHeight.Text = imageHeight
          tbWidth.Text = imageWidth
      End Sub
  End Class
  </code></pre>
  
  <p>I always got an error when running the program. I hope you can help me with this one. Thank you</p>