f



matlab-like command window for c++

Hi all,

I have been using Matlab since I bought it a couple years back. I am trying to learn C++ now on a linux machine using emacs editor. This is fine. However, C++ does not have a command window like Matlab with the capability to nicely display matrices and vector outputs or to directly run functions from. 

Is there any way I can somehow run my C++ functions in matlab without much modifications to the raw C++ code so that vectors and matrices would be output in Matlab environment. Or, is there a matlab-like command window out there for C++ I'm not aware off?

thanks,
ben
0
cloader41 (8)
4/26/2012 1:07:46 AM
comp.soft-sys.matlab 211266 articles. 23 followers. lunamoonmoon (257) is leader. Post Follow

3 Replies
861 Views

Similar Articles

[PageSpeed] 57

"ben " <cloader41@gmail.com> wrote in message <jna752$rih$1@newscl01ah.mathworks.com>...
> Hi all,
> 
> I have been using Matlab since I bought it a couple years back. I am trying to learn C++ now on a linux machine using emacs editor. This is fine. However, C++ does not have a command window like Matlab with the capability to nicely display matrices and vector outputs or to directly run functions from. 
> 
> Is there any way I can somehow run my C++ functions in matlab without much modifications to the raw C++ code so that vectors and matrices would be output in Matlab environment. Or, is there a matlab-like command window out there for C++ I'm not aware off?

In general, no. What you *can* do is use the mex interface (see External Interfaces section in the doc) to get your variables over to MATLAB for display. This may involve reworking some of your code and/or copying your variables to MATLAB compatible variables. I would suggest reading the doc to get started, look at the examples they have, and then post specific questions about specific code when you get stuck.

James Tursa
0
4/26/2012 3:27:10 AM
On 04/25/2012 08:07 PM, ben wrote:
> Hi all,
>
> I have been using Matlab since I bought it a couple years back. I am
 >trying to learn C++ now on a linux machine using emacs editor.

To use c/c++ in interpreter manner try:

http://www.softintegration.com/

http://root.cern.ch/drupal/content/cint

--Nasser

0
Nasser
4/26/2012 5:02:29 AM
> Is there any way I can somehow run my C++ functions in matlab without much modifications to the raw C++ code so that vectors and matrices would be output in Matlab environment. 

Using MEX-files might be a solution: http://www.mathworks.com/support/tech-notes/1600/1622.html

> Or, is there a matlab-like command window out there for C++ I'm not aware off?

Yes, ROOT developed by CERN: http://root.cern.ch/drupal/

The same team is currently working on a C++ interpreter called "cling", which looks very promising:
http://root.cern.ch/drupal/content/cling-goes-public

CINT is going to be replaced by cling for the following reasons: http://root.cern.ch/drupal/content/do-we-need-yet-another-custom-c-interpreter

As for the "Ch", I've tried it, unfortunately it's mostly a C interpreter, the support for C++ is extremely limited and almost non-existent.
0
4/30/2012 7:34:07 PM
Reply:

Similar Artilces:

C/C++ in matlab and matlab in C/C++ ?
Is it possible to read C/C++ code in matlab and the other way around too? Hi, as long as C or C++ are written in text files you can edit them in the matlab editor. To see the special character of C or C++ coding language, in the editor go to menus: file>preferences>Edito/Debugger>language and on popup "Language" select "C/C++". This does not allow you to run the C/C++ code, just to view it i nicer way... regards, chris saneman <asdfsdf@asd.com> wrote in message <frl846 $f8i$2@news.net.uni-c.dk>... > Is it possible to read C/C...

methods to call matlab in C C++ and call C C++ in matlab
Hi, I am reading the help documents about how to program matlab and C C++ together and my questions are a little bit general. It seems that are several ways to call matlab in C C++ and another several ways to call C C++ in matlab. Please correct me if I am wrong or missing something when I try to list them. To call matlab code in C C++, are there two methods available? The first one is Matlab engine and the second one is to use MATLAB Compiler mcc to create C or C++ shared libraries from your MATLAB code. To call C C++ in matlab, are there also two methods? The first one is to call funct...

Matlab command to convert Matlab script to C
I know that this has probably been asked before but I desperately need to do this. I have simple scripts in Matlab and I would like to see what they look like in C language. Can anyone help me with this? I'm not a great C programer so this would help me immensly if I could see various examples of things that I have written in Matlab in C Thank you. Hi finiteguy, check the MATLAB help for the MATLAB Compiler, if you have. Regards, Stefan Hi Stefan, I tried that and got no help. Nothing about Matlab compiler. I kew that years ago there was a simple command but I lost it. On Mon, 30...

EngSim: All Matlab features and functions. 2 to 20 Times Faster than MATLAB. Use the same programming syntax as MATLAB, ANSI C/C++, /C++. Good Graphics.
ENGSIM is an Engineering Simulation & Graphics Library for Microsoft Visual C++. It has all Matlab features and functions. 2 to 20 Times Faster than MATLAB. Very Easy to program. Use the same programming syntax as MATLAB, ANSI C/C++. Graphics Support is Very Good. Support Negative Indexing for Array/Matrix, Complex Array and Complex Matrix. Support Fix-point/Floating-point Communications Engineering and Signal Processing Simulation. Support Statistical Analysis. Support User- Defined Classes. Support User-Graphics Development ...

the command to print out the matlab build in function scripts in the matlab window?
Does any body still remember the command to print out the matlab build-in functions? for example, how could I pull out the script for sqrt.m file? and similarly, the scripts for the simulink blocks? Thanks in advance. Cindy Cindy Li wrote: > Does any body still remember the command to print out the matlab build-in > functions? for example, how could I pull out the script for sqrt.m file? > and similarly, the scripts for the simulink blocks? >> type sqrt.m %SQRT Square root. % SQRT(X) is the square root of the elements of X. Complex % results are produced if X is not...

matlab beginner: calling matlab from C/C++
I'm relatively new to the world of Matlab. I want to call my matlab own code from a C/C++ program on a machine with matlab installed. Do I need to compile the matlab code using matlab compiler tool or the matlab engine is enough for this? Thanks a lot for your help On Nov 28, 10:03 am, "Paeo Campigotto" <campigo...@dit.unitn.it> wrote: > I'm relatively new to the world of Matlab. > I want to call my matlab own code from a C/C++ program on a > machine with matlab installed. > Do I need to compile the matlab code using matlab compiler > tool or the matla...

vectorized computation in C++ such as those in Matlab (Matlab to C++)?
Dear all, Can C++/STL/Boost do the vectorized calculation as those in Matlab? For example, in the following code, what I really want to do is to send in a vector of u's. All other parameters such as t, l1, l2, l3, etc. are scalars... But u is a vector. Thus, t6 becomes a vector. t9 is an element-wise multiplication... The following code was actually converted from Matlab. If vectorized computation is not facilitated, then I have to call this function millions of times. But if vectorized computation is okay, then I can send in just a u vector with batch elements a time. I have man...

invoking matlab functions from unix shell prompt instead of matlab command window....
Hi All, I was wondering if there is a way to invoke matlab commands from outside the matlab command window - say from unix shell prompt or windows dos prompt. I am particularly interested in emlc/emlmex for converting matlab code to C. TIA. ...

matlab beginner: calling matlab from C/C++ #3
I'm relatively new to the world of Matlab. I want to call my matlab own code from a C/C++ program on a machine with matlab installed. Do I need to compile the matlab code using matlab compiler tool or the matlab engine is enough for this? Thanks a lot for your help ...

matlab beginner: calling matlab from C/C++ #2
I'm relatively new to the world of Matlab. I want to call my matlab own code from a C/C++ program on a machine with matlab installed. Do I need to compile the matlab code using matlab compiler tool or the matlab engine is enough for this? Thanks a lot for your help ...

Conversion from MATLAB to C/C++ using MATLAB compiler
I am working on conversion of .m files to c/c++. I am using the MATLAB compiler version 3.0 and MATLAB version 6.5.1. There seem to be a few functions which do not seem to get converted. The error i got while using functions like TRAIN, NETWORK and INIT (all neural-networks related functions used in the general neural network programs, newpnn.m etc) is The MATLAB compiler does not currently support MATLAB object oriented programming and the functions TRAIN , NETWORK and INIT would produce a run-time error. Could anyone please tell me as to how i can circumnavigate this problem or solve this...

Calling Matlab in C in Matlab
Hi everybody! My problem can be described as follows. I have a tool in Matlab that requires calling an optimisation algorithm in C. This algorithm consists of several C-files, one of which contains the function to be minimised (CFUNCTION), and another is the main algorithm file (CMAIN). Now what I want to do is to call Matlab from CFUNCTION or CMAIN and specify my custom function (MFUNCTION) to be minimised. So, I'm calling Matlab from C from Matlab. I'm a newbie in C and MEX files. Should I rewrite CMAIN as a MEX file and include CFUNCTION in this and then use mxCallMATLAB? Or can...

a MATLAB command like '_kbhit' in C
Hi Is there a MATLAB command like '_kbhit' in C which returns a nonzero value if a key has been pressed. Otherwise, it returns 0? ...

Create (Matlab) object inside C/C++ and pass it to Matlab
I'm trying to create an object inside C++ and then pass it to Matlab via en= gPutVariable. It seems I can create a struct // Create a float array mxArray *acq_data =3D mxCreateNumericMatrix(0, 0, mxSINGLE_CLASS); float *data =3D (float *)mxCalloc(M*N, sizeof(float)); mxSetData(acq_data, data); mxSetM(acq_data, M); mxSetN(acq_data, N); // Convert to struct const char *fieldname =3D "data"; mxArray *acq_struct =3D mxCreateStructMatrix(1,1,1, &fieldname); mxSetField(acq_struct,i,"data",acq_data); // Convert to class ?? Does it work? if (j=3D=3D1...

Web resources about - matlab-like command window for c++ - comp.soft-sys.matlab

Resources last updated: 2/4/2016 3:35:57 PM