I try to run old utility on matlab 7 and get an error "Unable to load mex file: readchan.dll. Invalid MEX-file readchan.dll'" .is there a solution ?

2 件のコメント

Walter Roberson
Walter Roberson 2015 年 11 月 8 日
Any relationship to "beamforming for Fieldtrip"? https://github.com/yuval-harpaz/ft_BIU
yaakov bar-on
yaakov bar-on 2015 年 11 月 8 日
No. there isn't relationship to "beamforming for Fieldtrip", but to a gui which show results of simulation.

サインインしてコメントする。

回答 (2 件)

Image Analyst
Image Analyst 2015 年 11 月 7 日

1 投票

Do you have a prototype file or .h file for it? Here's how I load a DLL I use from Measurement Computing Corporation:
% A deployed (compiled) application, must use a prototype file instead of a header file.
% A source code file can either do it this way or use a .h file.
% To create the prototype file you must use the loadlibrary mfilename option.
% Use the prototype file in compiled code.
% Create prototype file, mxproto.
% hfile = fullfile(matlabroot,'extern','include','matrix.h');
% loadlibrary('libmx',hfile,'mfilename','mxproto')
% MATLAB creates the file, mxproto.m, in the current folder.
% loadlibrary('cbw64', hFileName, @cbw_prototype_file)
fprintf('Loading MCC library with prototype file ...\n');
[notFound, warnings] = loadlibrary('cbw64', @cbw_prototype_file);
Then, later when I want to call a function in the DLL:
% Call the "cbDBitIn" function in the DLL to check the state of the pin.
% int EXTCCONV cbDBitIn (int BoardNum, int PortType, int BitNum, USHORT *BitValue);
% The board checks the pin voltage 30 times per second.
[errorCode, BitValue2] = calllib('cbw64', 'cbDBitIn', BoardNum, PortType, BitNum, BitValue);

2 件のコメント

yaakov bar-on
yaakov bar-on 2015 年 11 月 8 日
Thank you for your answer. I need to find the prototype file for this utility. I believe that the problem related to an older compilation of mex file which was done on old windows version of 32 bits. now i have windows 7 64 bits. probably i need to compile it again
Image Analyst
Image Analyst 2015 年 11 月 8 日
64 bit MATLAB cannot run 32 bit DLL's. I have an old 32 bit DLL and whenever I need to use that program I need to switch to 32 bit MATLAB.

サインインしてコメントする。

Walter Roberson
Walter Roberson 2015 年 11 月 8 日

1 投票

32 bit dll cannot be used with 64 bit versions of MATLAB. You will need to get a version built for 64 bit MATLAB.

1 件のコメント

yaakov bar-on
yaakov bar-on 2015 年 11 月 8 日
編集済み: yaakov bar-on 2015 年 11 月 8 日
Thank you for your answer. As you wrote, I believe that the problem related to an older compilation of mex file which was done on old windows version of 32 bits. now i have windows 7 64 bits. probably i need to compile it again

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMATLAB Compiler についてさらに検索

質問済み:

2015 年 11 月 7 日

コメント済み:

2015 年 11 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by