Databases Reference
In-Depth Information
If MatRef > UorLCase Then
MatRef = MatRef - 1
End If
TextBox_Array.Text = Chr(MatRef)
End Sub
Private Sub SpinButton_SpinUp()
Dim MatRef As Integer
MatRef = Asc(TextBox_Array.Text)
If MatRef < (UorLCase + 25) Then
MatRef = MatRef + 1
End If
TextBox_Array.Text = Chr(MatRef)
End Sub
Once a matrix or vector object has been chosen and a letter has been selected to represent the
chosen matrix or vector, the user can write the matrix or vector to Matlab by pressing the “Map
Values into Variable” button. When this button is pressed, the Matrix will be written into Matlab
using the specified identifier with the following code:
Private Sub Button_SetMatrix_Click()
If frm9ShowMatrix.ComboBox_Worksheets.Text <> "" Then
Call RunMatrixBuilder
Else
MsgBox "You must choose a Worksheet!", vbOKOnly +
vbExclamation, "Missing Parameter"
End If
End Sub
If a Worksheet has not been specified in the GUI from which to pull the matrix data, the process
will be halted. Otherwise, the
subroutine will be called.
RunMatrixBuilder
Sub RunMatrixBuilder()
'Build Matrices in Excel -> Export to Matlab
Dim startcol As Integer, endcol As Integer
Dim startrow As Integer, endrow As Integer
Dim row As Integer, Col As Integer
Dim ReturnMsg As String, SendMsg As String
'ReEstablish Connection to Matlab Object
Set MatLab = CreateObject("Matlab.Application")
'Determine Array Size
Select Case frm9ShowMatrix.OB_Auto
Case True 'Auto Range Size
'Matrix Always starts at A1
startcol = 1: startrow = 1
endcol = LastCol(ActiveWorkbook.Name,
frm9ShowMatrix.ComboBox_Worksheets.Text)
Search WWH ::




Custom Search