⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vb_disp_matlab.frm

📁 在VB环境中调用MATLAB函数
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   6870
   ClientLeft      =   60
   ClientTop       =   495
   ClientWidth     =   9480
   LinkTopic       =   "Form1"
   ScaleHeight     =   6870
   ScaleWidth      =   9480
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdDisp 
      Caption         =   "MATLAB图形显示"
      Height          =   495
      Left            =   7440
      TabIndex        =   0
      Top             =   6120
      Width           =   1575
   End
   Begin VB.Image imgDispMatlab 
      Height          =   5655
      Left            =   480
      Top             =   240
      Width           =   8535
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit


Private Sub cmdDisp_Click()
    Dim objMATLAB As Object
    Set objMATLAB = CreateObject("matlab.application")
    Dim strEnter As String
    Dim strCMD As String
    strEnter = Chr(13) & Chr(10)
    strCMD = "[x,y,z]=peaks(30);"
    strCMD = strCMD & strEnter
    strCMD = strCMD & "figure('menubar','none');surfc(x,y,z)"
    strCMD = strCMD & strEnter
    strCMD = strCMD & "shading interp"
    strCMD = strCMD & strEnter
    strCMD = strCMD & "saveas(gcf,'c:\temp\peaks.bmp')"
    objMATLAB.execute (strCMD)
    imgDispMatlab.Picture = LoadPicture("c:\temp\peaks.bmp")
    imgDispMatlab.Refresh
    Set objMATLAB = Nothing
End Sub

Private Sub Form_Load()

    With imgDispMatlab
        .Stretch = True
    End With
       
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -