Simple question
Simple question
(OP)
Hello ,
I need the Sign() function in C++
so I added :
#include "matlab.hpp"
at the header file of my program
now VC ++ doesn't find any "matlab.hpp" , and so do I ...
yes , I've installed MathLab , R12
so what's the problem ??
tankzalot.
I need the Sign() function in C++
so I added :
#include "matlab.hpp"
at the header file of my program
now VC ++ doesn't find any "matlab.hpp" , and so do I ...
yes , I've installed MathLab , R12
so what's the problem ??
tankzalot.





RE: Simple question
TTFN
RE: Simple question
matlab.hpp??
I haven't got any matlab.hpp ??
I do got matlab.h ...
my matlab dir = D:\matlabR12
what directory do you mean ??
(I'm really new at matlab so thanx for the patience)
thanx!!
RE: Simple question
I have all available help files for Matlab loaded and search does not find anything about "matlab.hpp". But, there is a matlab.h!
RE: Simple question
I'm not getting the feeling that you understand C sufficiently for you to do this. Why not simply write your own sign function? Unless you have a throughput problem?
sign(x) = x/|x| for x<>0
or
sign(x) = if(x<>0,if(x>0,"+","-"),"x=0")
or several other possibilities.
TTFN
RE: Simple question
this is the explanation of matlab.hpp .
__
http://www.google.be/search?q=matlab.hpp&ie=UTF-8&oe=UTF-8&hl=nl&meta=
-> more matlab.hpp
___
.hpp stands for c++ header
___
I actually did write my own sign() function ,
but I'm still not wiser on how to use matlab with C++ ??
RE: Simple question
C:\matlab6p5\extern\examples\cppmath
adjust the C:\ and the matlab6p5 to whatever your directory names are.
Otherwise, matlab will not be able to find the C++ math library. Which appears to be your problem.
RE: Simple question
In your project setteings you should do following
1) add lib files to your project settings under link bookmark
Go to MATLAB help
Using the C++ Math Library: Getting Started: Linking Applications Without mbuild (I strongly suggest you to read Getting started and Fundamential of the help)
to see which lib files to connect.
2) Also check "Disable Language extensions"
3) add preprocessor definition "MS_WIN_API"
4) and still I had to "force file output"
In Tools -> Options -> directories put all the nessessary paths to the libraries and include files
It doesn't worth it just for a sign function.