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

📄 midevatestview.cpp

📁 MATLAB混合编程想把matlab强大的功能用在自己的工程实践中吗这是本不错的混合编程的书
💻 CPP
字号:
// MidevaTestView.cpp : implementation of the CMidevaTestView class
//

#include "stdafx.h"

#include "matlib.h"

#include "MidevaTest.h"

#include "MidevaTestDoc.h"
#include "MidevaTestView.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CMidevaTestView

IMPLEMENT_DYNCREATE(CMidevaTestView, CView)

BEGIN_MESSAGE_MAP(CMidevaTestView, CView)
	//{{AFX_MSG_MAP(CMidevaTestView)
	ON_COMMAND(ID_MIDEVA_CPP, OnMidevaCpp)
	ON_COMMAND(ID_MIDEVA_EXE, OnMidevaExe)
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMidevaTestView construction/destruction

CMidevaTestView::CMidevaTestView()
{
	// TODO: add construction code here

}

CMidevaTestView::~CMidevaTestView()
{
}

BOOL CMidevaTestView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CMidevaTestView drawing

void CMidevaTestView::OnDraw(CDC* pDC)
{
	CMidevaTestDoc* pDoc = GetDocument();
	ASSERT_VALID(pDoc);
	// TODO: add draw code for native data here
}

/////////////////////////////////////////////////////////////////////////////
// CMidevaTestView printing

BOOL CMidevaTestView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CMidevaTestView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CMidevaTestView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CMidevaTestView diagnostics

#ifdef _DEBUG
void CMidevaTestView::AssertValid() const
{
	CView::AssertValid();
}

void CMidevaTestView::Dump(CDumpContext& dc) const
{
	CView::Dump(dc);
}

CMidevaTestDoc* CMidevaTestView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMidevaTestDoc)));
	return (CMidevaTestDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CMidevaTestView message handlers

void CMidevaTestView::OnMidevaCpp() 
{
	// TODO: Add your command handler code here
	initM(MATCOM_VERSION);
	dMm(t); dMm(x); dMm(y); dMm(z); 
	
#line 1 "c:/matcom45/samples/gbyang.m"
	call_stack_begin;
#line 1 "c:/matcom45/samples/gbyang.m"
	_ t = colon(0.0,pi/20.0,2.0*pi);
#line 2 "c:/matcom45/samples/gbyang.m"
	_ /*[x,y] = */meshgrid(t,i_o,x,y);
	
#line 4 "c:/matcom45/samples/gbyang.m"
	_ subplot(2.0,2.0,1.0);
#line 5 "c:/matcom45/samples/gbyang.m"
	_ plot((CL(sin(t)),cos(t)));
#line 6 "c:/matcom45/samples/gbyang.m"
	_ axis(TM("equal"));
	
#line 8 "c:/matcom45/samples/gbyang.m"
	_ subplot(2.0,2.0,2.0);
#line 9 "c:/matcom45/samples/gbyang.m"
	_ z = sin(x)+cos(y);
#line 10 "c:/matcom45/samples/gbyang.m"
	_ plot((CL(t),z));
#line 11 "c:/matcom45/samples/gbyang.m"
	_ axis((BR(0.0),2.0*pi,-2.0,2.0));
	
#line 13 "c:/matcom45/samples/gbyang.m"
	_ subplot(2.0,2.0,3.0);
#line 14 "c:/matcom45/samples/gbyang.m"
	_ z = sin(x);
#line 15 "c:/matcom45/samples/gbyang.m"
	_ z = times(sin(x),cos(y));
#line 16 "c:/matcom45/samples/gbyang.m"
	_ plot((CL(t),z));
#line 17 "c:/matcom45/samples/gbyang.m"
	_ axis((BR(0.0),2.0*pi,-1.0,1.0));
	
#line 19 "c:/matcom45/samples/gbyang.m"
	_ subplot(2.0,2.0,4.0);
#line 20 "c:/matcom45/samples/gbyang.m"
	_ z = (power(sin(x),2.0))-(power(cos(y),2.0));
#line 21 "c:/matcom45/samples/gbyang.m"
	_ plot((CL(t),z));
#line 22 "c:/matcom45/samples/gbyang.m"
	_ axis((BR(0.0),2.0*pi,-1.0,1.0));
	
	call_stack_end;	

	exitM();
	
}

void CMidevaTestView::OnMidevaExe() 
{
	// TODO: Add your command handler code here
	WinExec("gbyang.exe", SW_SHOW);
}

⌨️ 快捷键说明

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