|
Hi there,
how are you doing?
I want help in image processing toolbar, iam making project (for image
enhancement and motion detection) functions in and want to
conver
them in .dll and connect it with the C# project
How to return value from matlab functions as images into C# (as bitmap)
PLEASE URGENT HELP REQUIRED, I HAVE COMPLETED THE MATLAB FUNCTIONs AND
NOW HAVE TO CONNECT WITH THE C#.......
THANKING YOU
HAROON, ISB PK
There are Things you cannot Do, and there are Words you cannot Say
|
|
|
|
|
Dear A. Riazi,
Salam Alekum Wa Rahmet Allah Wa Barakatuh.
I have probelm in converting my MATLAB program to C code. So can u help me concerning this problem.
I already tried to use mcc command with all appotinuity which this command offers.
I am needing a solution for urgent.
Appreciate your cooperation previously
|
|
|
|
|
Please help.
I'm getting the error, when I'm trying to execute the project:
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
First-chance exception in MatlabSharedLib.exe: 0xC0000005: Access Violation.
|
|
|
|
|
Do you get this when executing the mclInitializeApplication (NULL , 0); ?
Or when executing the "YourLib"Initialize() ?
In case of the first, be sure to have the DLL and the CTF at the same place as your EXE.
Also, you can enter the path to the CTF (what happens to be the same as to your exe) in the project properties unter "General - Debugging - Working Directory".
In case of the second, I would be glad to have that solved.
I am thinking that there is some conflict with DLLs of mine, but I have no idea how to get rid of it.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Hi,
I have the same problem on VC++ 6.0, windows XP, SP2.
If you remove mclInitializeApplication(...) function call the error will dissapear.
When I compile my project i don't have any error or warning but when i try to debug it the "First-chance exception in liba.exe: 0xC0000005: Access Violation." debug message appear and the execution is broken in mainCRTStartup().
I notice that i'm using liba.lib and mclmcr.lib to link it(liba.lib is the library generated by Matlab Compiler for my matalb function). In the same time the CTF and DLL files are in the same place with the exe file.
Can you help me in this way?
|
|
|
|
|
Bonta Marian S wrote: If you remove mclInitializeApplication(...) function call the error will dissapear.
But then you are unable to call matlab-code, as it is uninitialized...
Bonta Marian S wrote: "First-chance exception in liba.exe: 0xC0000005: Access Violation."
"First Chance exceptions" are normal. It seems as if the Matlab-guys use exeptions as normal ways of code control.
In the debugger, you can select somewhere, that you only want to break on second chance-exceptions, that is unhandled exceptions.
I am sorry that I can not point out where it is or what the exact name of the setting is, but I am using only VC 2003 and 2005.
-- typo fixed at 13:11 Wednesday 4th July, 2007
Failure is not an option - it's built right in.
|
|
|
|
|
Hi,
It's seems to be some problems when you try to use this method (MATLAB Shared Library) on VC++ 6.0.
To avert this problem you can use MATLAB Visual Add-in feature. This feature is available from Matlab 7.x and offers you a simple method to use the Matlab code.
|
|
|
|
|
I am a new user. I have a library and I want to add it to the system that I have. Can someone please help me out. I already do have the library but I want to add it to the system that I have
|
|
|
|
|
have a simple M-file in matlab environment, i want to work it in C# .NET
function y = foo(x)
y = x+1;
first of all i compil the Mfile to COMObject ,i use matlab 'mcc' function :
mcc -B 'ccom:addin,addin,1.0' foo.m
i basic on this sample :
-t -W com:<component_name>,<class_name>,<version> -T link:lib
in this link : http://www-rohan.sdsu.edu/doc/matlab/toolbox/compiler/mcc.html
secondly i open a winApplication in .NET 2003 and add the dll in 'Add
References'
after that i create a new object from the dll that matlab compiler
build (addin.dll in my case),and try to usa it , the .NET recognize
and fill my after dot foo founcatio.
i try to run it and get a Runtime Error !:
"Microsoft Visual C++ Runtime Library
abnormal program temination"
if u can help me , i be grateful.
Thx
|
|
|
|
|
do you get the same error if you access it from VB or Excel VBA?
try entering a return in the end and then compile. that might fix it.
|
|
|
|
|
|
I am trying to build a shared library (DLL) from m-File.The problem is that I need to use the graphics library.I know that I must bundle the libmwsglm.mlib library(using the command mcc) but I couldn't find how do it . Now I'm looking for a way to create a .dll (using graphics library)and after use it for example in C#.I think that somebody can help me and your help will be very useful for me.
Regards,
Marcel
|
|
|
|
|
Hi:
Does some body know how to compile this example using Matlab 7(R14) and Visual C.Net
Thanks
Pedro Luis Sanchez Orellana
|
|
|
|
|
|
I use matlab 6.5 and MS .NET 7.0 and I've done the following two trial:
In my console application (.NET and WIN) and use:
- your original .dll function MeanFunction.
- MY own .dll function that use your original .dll function MeanFunction.
It is OK.
But if I use in MATLAB
mcc -t -L C -W lib:MeanFunctionLib -T link:lib MeanFunction.m libmmfile.mlib
to produce .dll then MATLAB generate different (wrong) MeanFunctionLib.dll file. I get a running mistake. Everything is the same. But MATLAB generate wrong file. I use default compilator.
Do you have an idea ... ???
|
|
|
|
|
Hi,
I have some question, please help me:
1. I did all steps as you show. But in VS C++ 6.0 :
mxArray* sum;
mxArray* x;
mxArray* y;
double myArray[2]={5, 10};
x = mxCreateDoubleMatrix(1, 1, mxREAL);
y = mxCreateDoubleMatrix(1, 1, mxREAL);
memcpy(mxGetPr(x), myArray, sizeof(double));
memcpy(mxGetPr(y), myArray+1, sizeof(double));
MySumFunctionLibInitialize();
sum = mlfMysumfunction(x, y);
MySumFunctionLibTerminate();
lfPrintMatrix(sum);
mxDestroyArray(x);
mxDestroyArray(y);
mxDestroyArray(sum);
At the 5th line, when I debug, it have a error "The instruction at "0x00017b00" referenced
memory at "0x00017b00. The memory could not be "read" ", and my application terminates.
2. Why MathLab Add-in can't compile in Windows Server 2003, but ok in Windows 2000 ?
3. How can I use MatLab function in VS C++ 6.0 ?
4. Is there only one type variable connect between MatLab and VC ?
Thanks.
123
|
|
|
|
|
I am using Matlab R13 and MSVC 6.0
I can successfully compile my .m file into .h .dll and .lib. All of them are of C-style, i.e. the data type are mxArray. Is it possible to compile them in C++ style (mwArray)?
I tried -L cpp options but it doesn't work even in the simplest case:
% Here is "test.m"
% function a = test(b)
% a = b+1;
mcc -t -L cpp -W lib:testlib -T link:lib -h test.m libmmfile.mlib
mcc says:
--> "link "/out:testlib.dll" kernel32.lib user32.lib gdi32.lib advapi32.lib oleaut32.lib ole32.lib /LIBPATH:"D:\MATLAB6p5\extern\lib\win32\microsoft\msvc60" libmatlb.lib /nologo libmx.lib libmat.lib libmwservices.lib libmex.lib libut.lib /dll /implib:"testlib.lib" /def: D:\MATLAB6p5\extern\lib\win32\libmatpm.lib @7444_tmp.rsp "
LINK : fatal error LNK1146: no argument specified with option "/def:"
MBUILD.BAT: Error: Link of 'testlib.dll' failed.
??? Error using ==> mbuild
Unable to complete successfully
??? Error: An error occurred while shelling out to mbuild (error code = 1).
Unable to build executable.
Error in ==> D:\MATLAB6p5\toolbox\compiler\mcc.dll
Thanks in advance.
|
|
|
|
|
I am trying to write code in MATLAB to communicate with a piece of proprietary hardware. Along with the hardware, I was given a driver file and some source code to define the functions that control the hardware via the driver. This source code includes files of the following extensions: .h, .c, .dsp, .dsw, and .lib (created with MS Visual Studio)
I need to be able to include these function descriptions in my code. How do I go about doing so?
Thanks in advance,
Michael
|
|
|
|
|
Hi,
You must create the MATLAB MEX file. See my article about MEX files here:
- MATLAB MEX-files[^]
Best regards,
A. Riazi
|
|
|
|
|
Hi Riazi,
I've installed the MATLAB Compiler 7. Now the mcc command is working but there is no cpp directory in the x:\matlab\extern\include\cpp for "matlab.hpp" also there is no file "matlab.h" in x:\matlab\extern\include\. There are no lib files "libmatpm.lib, libmatlb.lib, libmmfile.lib" in "x:\matlab\extern\lib\win32\microsoft\msvc71\"
I use "mcc -t -L C -W lib:MeanFunctionLib -T link:lib MeanFunction.m" to create "MeanFunctionLib.dll, MeanFunctionLib.lib and MeanFunctionLib.h"
Its giving me the error of Linking with "mcInitializeApplication".
Please help me how to run the simple MeanFunction.m from VC++.
Thanks & Regards,
Ardhendu
|
|
|
|
|
I wrote this article and it's source code with MATLAB 6.5 (version 13). I didn't install MATLAB 7 and unfortunately don't know anything about it's files & directories structure.
Best regards,
A. Riazi
|
|
|
|
|
Hi Riazi,
I read your article "MATLAB Shared LIbrary" and it is very interesting to me. I wish to access my function from the VC++. I download your code, but in my MATLAB 6.5 there is no library "libmmfile.lib" in "C:\MATLAB6p5\extern\lib\win32\microsoft\msvc60". Also there is no "Matlab.h" in the directory C:\MATLAB6p5\extern\include\".
Could you please help me how to compile the project without this files?
Also in my previous mail. I asked about the "MCC" commands in the MATLAB command window. It is not recognize in my Matlab command window.
Could you please help me???
Thanks & Regards,
Ardhendu
|
|
|
|
|
I read your message, it seems that you didn't install the MATLAB C/C++ MATH library toolbox.
For compiling your m-files or using MATLAB shared library or ..., you must have this toolbox (you should purchase it )
Best regards,
A. Riazi
|
|
|
|
|
Thanks a lot. I've to look for that..
|
|
|
|
|
Hi,
I'm new to the matlab and I want to call my matlab function
Myfun.m from my C code (VC++). I checked for building the DLL for the VC++. The command is "mcc". This command is not recognize in my MATLAB 6.5 command window.
Can anybody help me about this??
Thanks in advance.
Regards,
Ardhendu
|
|
|
|