how to call C++ from MATLAB

조회 수: 2 (최근 30일)
nkumar
nkumar 2013년 5월 31일
Ihave code for C++,plz tell how to call it from matlab
#using <System.dll>
using namespace System;
using namespace System::Net;
using namespace System::IO;
int main()
{
array<String^>^args = Environment::GetCommandLineArgs();
if ( args == nullptr || args->Length == 1 )
{
throw gcnew ApplicationException( "Specify the URI of the resource to retrieve." );
}
WebClient^ client = gcnew WebClient;
// Add a user agent header in case the
// requested URI contains a query.
client->Headers->Add( "user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)" );
Stream^ data = client->OpenRead( args[ 1 ] );
StreamReader^ reader = gcnew StreamReader( data );
String^ s = reader->ReadToEnd();
Console::WriteLine( s );
data->Close();
reader->Close();

답변 (0개)

카테고리

Help CenterFile Exchange에서 Call MATLAB from C++에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by