f



problems getting MATLAB data in C++ program

Hi I am using the MX functions to get read MATLAB data in C and have been able to read the MATLAB data for MATLAB arrays and structures (created using the keword struct) but am having issues reading the data from a MATLAB structure array like test(1).dataelement1, test(1).dataelement2.  Does anyone know what mx method to use?  Also I think MATLAB must store additional information about the structure array as if I set the variable that I bring over to C to the first element in MATLAB I can read only the first value of the structure array.  Any ideas?
0
12/27/2011 6:47:08 PM
comp.soft-sys.matlab 211266 articles. 23 followers. lunamoonmoon (257) is leader. Post Follow

6 Replies
979 Views

Similar Articles

[PageSpeed] 44

"Paul" wrote in message <jdd3rc$km1$1@newscl01ah.mathworks.com>...
> Hi I am using the MX functions to get read MATLAB data in C and have been able to read the MATLAB data for MATLAB arrays and structures (created using the keword struct) but am having issues reading the data from a MATLAB structure array like test(1).dataelement1, test(1).dataelement2.  Does anyone know what mx method to use?  Also I think MATLAB must store additional information about the structure array as if I set the variable that I bring over to C to the first element in MATLAB I can read only the first value of the structure array.  Any ideas?

Use mxGetField. E.g., if you pass in the structure as the first argument:

mxArray *test_dataelement1, *test_dataelement2;
    :
test_dataelement1 = mxGetField(prhs[0],0,"dataelement1");
test_dataelement2 = mxGetField(prhs[0],0,"dataelement2");

James Tursa
0
12/27/2011 7:15:09 PM
"James Tursa" wrote in message <jdd5ft$pvl$1@newscl01ah.mathworks.com>...
> "Paul" wrote in message <jdd3rc$km1$1@newscl01ah.mathworks.com>...
> > Hi I am using the MX functions to get read MATLAB data in C and have been able to read the MATLAB data for MATLAB arrays and structures (created using the keword struct) but am having issues reading the data from a MATLAB structure array like test(1).dataelement1, test(1).dataelement2.  Does anyone know what mx method to use?  Also I think MATLAB must store additional information about the structure array as if I set the variable that I bring over to C to the first element in MATLAB I can read only the first value of the structure array.  Any ideas?
> 
> Use mxGetField. E.g., if you pass in the structure as the first argument:
> 
> mxArray *test_dataelement1, *test_dataelement2;
>     :
> test_dataelement1 = mxGetField(prhs[0],0,"dataelement1");
> test_dataelement2 = mxGetField(prhs[0],0,"dataelement2");
> 
> James Tursa
Hi James, thanks for the response, I was able to add the code but was not sure how to extract the data from the mxArray pointer test_dataelement1?  I tried
double firstvalue = test_dataelement1[0]; but get the error invalid use of mxArray tag?
0
12/27/2011 10:16:08 PM
"Paul" wrote in message <jddg38$kd$1@newscl01ah.mathworks.com>...
> "James Tursa" wrote in message <jdd5ft$pvl$1@newscl01ah.mathworks.com>...
> > "Paul" wrote in message <jdd3rc$km1$1@newscl01ah.mathworks.com>...
> > > Hi I am using the MX functions to get read MATLAB data in C and have been able to read the MATLAB data for MATLAB arrays and structures (created using the keword struct) but am having issues reading the data from a MATLAB structure array like test(1).dataelement1, test(1).dataelement2.  Does anyone know what mx method to use?  Also I think MATLAB must store additional information about the structure array as if I set the variable that I bring over to C to the first element in MATLAB I can read only the first value of the structure array.  Any ideas?
> > 
> > Use mxGetField. E.g., if you pass in the structure as the first argument:
> > 
> > mxArray *test_dataelement1, *test_dataelement2;
> >     :
> > test_dataelement1 = mxGetField(prhs[0],0,"dataelement1");
> > test_dataelement2 = mxGetField(prhs[0],0,"dataelement2");
> > 
> > James Tursa
> Hi James, thanks for the response, I was able to add the code but was not sure how to extract the data from the mxArray pointer test_dataelement1?  I tried
> double firstvalue = test_dataelement1[0]; but get the error invalid use of mxArray tag?  I think I am not setting prhs correctly, seems as though it would need to be linked to the test_dataelement1 pointer?
0
12/27/2011 11:30:09 PM
"Paul" wrote in message <jddg38$kd$1@newscl01ah.mathworks.com>...
> "James Tursa" wrote in message <jdd5ft$pvl$1@newscl01ah.mathworks.com>...
> > "Paul" wrote in message <jdd3rc$km1$1@newscl01ah.mathworks.com>...
> > > Hi I am using the MX functions to get read MATLAB data in C and have been able to read the MATLAB data for MATLAB arrays and structures (created using the keword struct) but am having issues reading the data from a MATLAB structure array like test(1).dataelement1, test(1).dataelement2.  Does anyone know what mx method to use?  Also I think MATLAB must store additional information about the structure array as if I set the variable that I bring over to C to the first element in MATLAB I can read only the first value of the structure array.  Any ideas?
> > 
> > Use mxGetField. E.g., if you pass in the structure as the first argument:
> > 
> > mxArray *test_dataelement1, *test_dataelement2;
> >     :
> > test_dataelement1 = mxGetField(prhs[0],0,"dataelement1");
> > test_dataelement2 = mxGetField(prhs[0],0,"dataelement2");
> > 
> > James Tursa
>
> Hi James, thanks for the response, I was able to add the code but was not sure how to extract the data from the mxArray pointer test_dataelement1?  I tried
> double firstvalue = test_dataelement1[0]; but get the error invalid use of mxArray tag?

You need to extract the data pointer first, then dereference that. E.g., assuming that dataelement1 and 2 contain double class arrays, you would do this:

mxArray *test_dataelement1, *test_dataelement2;
double *pr1, *pr2;
    :
test_dataelement1 = mxGetField(prhs[0],0,"dataelement1");
if( test_dataelement1 == NULL ) {
    mexErrMsgTxt("insert error message here");
}
test_dataelement2 = mxGetField(prhs[0],0,"dataelement2");
if( test_dataelement2 == NULL ) {
    mexErrMsgTxt("insert error message here");
}
pr1 = mxGetPr(test_dataelement1);
pr2 = mxGetPr(test_dataelement2);
    :

pr1[0] is the first element, pr1[1] is the second element, etc.

If the underlying data is some other class, e.g. int32, then you would use mxGetData instead of mxGetPr and cast the resulting pointer appropriate to the underlying data.

James Tursa
0
12/28/2011 7:33:08 AM
"James Tursa" wrote in message <jdegnk$2k3$1@newscl01ah.mathworks.com>...
> "Paul" wrote in message <jddg38$kd$1@newscl01ah.mathworks.com>...
> > "James Tursa" wrote in message <jdd5ft$pvl$1@newscl01ah.mathworks.com>...
> > > "Paul" wrote in message <jdd3rc$km1$1@newscl01ah.mathworks.com>...
> > > > Hi I am using the MX functions to get read MATLAB data in C and have been able to read the MATLAB data for MATLAB arrays and structures (created using the keword struct) but am having issues reading the data from a MATLAB structure array like test(1).dataelement1, test(1).dataelement2.  Does anyone know what mx method to use?  Also I think MATLAB must store additional information about the structure array as if I set the variable that I bring over to C to the first element in MATLAB I can read only the first value of the structure array.  Any ideas?
> > > 
> > > Use mxGetField. E.g., if you pass in the structure as the first argument:
> > > 
> > > mxArray *test_dataelement1, *test_dataelement2;
> > >     :
> > > test_dataelement1 = mxGetField(prhs[0],0,"dataelement1");
> > > test_dataelement2 = mxGetField(prhs[0],0,"dataelement2");
> > > 
> > > James Tursa
> >
> > Hi James, thanks for the response, I was able to add the code but was not sure how to extract the data from the mxArray pointer test_dataelement1?  I tried
> > double firstvalue = test_dataelement1[0]; but get the error invalid use of mxArray tag?
> 
> You need to extract the data pointer first, then dereference that. E.g., assuming that dataelement1 and 2 contain double class arrays, you would do this:
> 
> mxArray *test_dataelement1, *test_dataelement2;
> double *pr1, *pr2;
>     :
> test_dataelement1 = mxGetField(prhs[0],0,"dataelement1");
> if( test_dataelement1 == NULL ) {
>     mexErrMsgTxt("insert error message here");
> }
> test_dataelement2 = mxGetField(prhs[0],0,"dataelement2");
> if( test_dataelement2 == NULL ) {
>     mexErrMsgTxt("insert error message here");
> }
> pr1 = mxGetPr(test_dataelement1);
> pr2 = mxGetPr(test_dataelement2);
>     :
> 
> pr1[0] is the first element, pr1[1] is the second element, etc.
> 
> If the underlying data is some other class, e.g. int32, then you would use mxGetData instead of mxGetPr and cast the resulting pointer appropriate to the underlying data.
> 
> James Tursa
Hi James, thanks for the additional information.  I am getting the following compiler error
on line test_dataelement1=mxGetField(prhs[0],0,"dataelement1");
prhs was not declared in this scope.  I tried adding const mxArray *prhs[2];  and it does get rid of the compiler error on that line but then I get a runtime error on that line.  Also wondering if I am missing an include file as when I added mexErrMsgTxt I get the error was not declared in this scope.  I have been able to read data from a matlab array dereferencing the pointer as you described.
0
12/28/2011 5:18:07 PM
"Paul" wrote in message <jdfj0f$fm0$1@newscl01ah.mathworks.com>...
>
> Hi James, thanks for the additional information.  I am getting the following compiler error
> on line test_dataelement1=mxGetField(prhs[0],0,"dataelement1");
> prhs was not declared in this scope.  I tried adding const mxArray *prhs[2];  and it does get rid of the compiler error on that line but then I get a runtime error on that line.  Also wondering if I am missing an include file as when I added mexErrMsgTxt I get the error was not declared in this scope.  I have been able to read data from a matlab array dereferencing the pointer as you described.

Please post your entire code so I can look at everything in context.

James Tursa
0
12/28/2011 9:12:08 PM
Reply:

Similar Artilces:

Exporting data from C++ to Matlab --> using pointers in c++ instead of...
If i have: //option 1 - it doesn't work float *nou; nou = (float *) calloc(50, sizeof(float)); //option 2 - it works float nou[15]; How can I send "nou" to Matlab if it's a pointer (option 1)??? - option 2 works with the code: I'm using this code: mxArray *TxNou = NULL; TxNou = mxCreateNumericMatrix(1, 15, mxSINGLE_CLASS, mxREAL); memcpy((void *)mxGetPr(TxNou), (void *)nou, sizeof(nou)); matlab.PutVariable("TxNou", TxNou); matlab.EvalString("plot(TxNou);"); I don't know what changes I have to do in the code - i've tried a lot of things... i don't find the error! Thanks for your advice, Oscar Oscar Esteve wrote: > If i have: > //option 1 - it doesn't work > float *nou; > nou = (float *) calloc(50, sizeof(float)); > //option 2 - it works > float nou[15]; > > How can I send "nou" to Matlab if it's a pointer (option 1)??? - > option 2 works with the code: > > I'm using this code: > mxArray *TxNou = NULL; > TxNou = mxCreateNumericMatrix(1, 15, mxSINGLE_CLASS, mxREAL); > memcpy((void *)mxGetPr(TxNou), (void *)nou, sizeof(nou)); Why not use mxGetData and avoid the cast? in option 1: sizeof(nou) = sizeof(float *) = 4 on 32 bit, 8 on 64bit. In option 2: sizeof(nou) = 15*sizeof(float) = 15*4 = 60 > matlab.PutVariable("TxNou", TxNou); > matlab.EvalString("plot(TxNou);"); > > I don'...

Shall i use the misrosoft Visual c++ code from a m-file generated from matlab in Visual C++ with out matlab runtime environment
undefined ...

matlab fit data problem #4
Hi all I use the code censusgui which is given by coler in his book as following ,this code try to fit the data p= [ 75.995 91.972 105.711 123.203 131.669 150.697 ... 179.323 203.212 226.505 249.633 281.422]'; t = (1900:10:2000)'; % Census years p as a function of t,but when I change the p to p= = [ 75.995 91.972 105.711 123.203 131.669 50.697(outlier) ... 179.323 203.212 226.505 249.633 281.422]'; this code always give me the same graph ,this is totally wrong,can anyone tell me what is wrong here? Thanks a lot function censusgui(callbackarg) %CENSUSGUI Try to predict the US population in the year 2010. % This example is older than MATLAB. It started as an exercise in % "Computer Methods for Mathematical Computations", by Forsythe, % Malcolm and Moler, published by Prentice-Hall in 1977. % The data set has been updated every ten years since then. % Today, MATLAB makes it easier to vary the parameters and see the % results, but the underlying mathematical principles are unchanged: % % Using polynomials of even modest degree to predict % the future by extrapolating data is a risky business. % % The data is from the decennial census of the United States for the % years 1900 to 2000. The task is to extrapolate beyond 2000. % In addition to polynomials of various degrees, you can choose % interpolation by a cubic spline, interpolation by a shape-preserving % Hermite cubic, and a least squares fit by an exponential. % Error estimat...

Calling MATLAB from a C++ program in Linux
Hi there, I'm trying to call the MATLAB engine from some C++ which I'm writing. I'm using Debian 6.0.4 64 bit. GCC version is 4.4.5-8. In order to test out what the built in engine can do, I thought a good place to start would be to compile one of the demos which comes with MATLAB (in this case, engdemo.cpp). I've install csh and when I call g++ engdemo.cpp, these are the errors I get: % g++ engdemo.cpp /tmp/ccD4qsD5.o: In function `main': engdemo.cpp:(.text+0xa8): undefined reference to `engOpen' engdemo.cpp:(.text+0xf4): undefined reference to `mxCreateDoubleMatrix' engdemo.cpp:(.text+0x104): undefined reference to `mxGetPr' engdemo.cpp:(.text+0x12d): undefined reference to `engPutVariable' engdemo.cpp:(.text+0x13e): undefined reference to `engEvalString' engdemo.cpp:(.text+0x14f): undefined reference to `engEvalString' engdemo.cpp:(.text+0x160): undefined reference to `engEvalString' engdemo.cpp:(.text+0x171): undefined reference to `engEvalString' engdemo.cpp:(.text+0x182): undefined reference to `engEvalString' engdemo.cpp:(.text+0x1b1): undefined reference to `mxDestroyArray' engdemo.cpp:(.text+0x1c2): undefined reference to `engEvalString' engdemo.cpp:(.text+0x1e1): undefined reference to `engOutputBuffer' engdemo.cpp:(.text+0x24e): undefined reference to `engEvalString' engdemo.cpp:(.text+0x282): undefined reference to `engGetVariable' engdemo.cpp:(.text+0x2aa): und...

Problem in coding GUI program in Matlab
I try to run GUI program in Matlab but it can connect each other I have main page window GUI, when I click the start button it will appear the run window GUI. Then when I try to run, it occur error I don't understand what is the error is about ??? Attempt to reference field of non-structure array. Error in ==> kejebaru>pushbutton1_Callback at 104 n=str2num(get(handles.input,'string')); Error in ==> gui_mainfcn at 96 feval(varargin{:}); Error in ==> kejebaru at 42 gui_mainfcn(gui_State, varargin{:}); Error in ==> @(hObject,eventdata)kejebaru('pushbutton1_Callback',hObject,eventdata,guidata(hObject)) ??? Error while evaluating uicontrol Callback May anyone help me please. Tq ...

some problems of codes of MATLAB 7.0 working on MATLAB 6.5
I have used MATLAB for few hours.So I don't know the differences between version 6.5 and 7.0.I want to use some codes of MATLAB 7.0, but they doesn't work in MATLAB 6.5.How to change these codes so that they can work in matlab 6.5.Waiting for your help. Thank you . The codes are like this .I think changing the function findPI may work ,but I don'y know how % PIfun.m % Evaluate a function used to find the PI-line, using Kyle Champley's % method. % % Adam Wunderlich % last update: 5/18/06 function y = PIfun(r,R,h,gamma,x3,sb) temp = R - r*cos(gamma-sb); y = h*((pi - 2*atan(r*sin(gamma-sb)/temp))*(1 + (r^2 - R^2)/ (2*R*temp)) ... + sb) - x3; % find_PI_Line.m % % Find the the parametric interval corresponding to the unique PI-line % passing through the point x for a given helical pitch. % This code implements the method of Kyle Champley. % inputs: P = pitch (cm/turn), R = helix radius, delta_s = s stepsize, x % output: PI = [sb st] % % Adam Wunderlich % last update: 5/18/06 function [PI] = findPI(P,R,delta_s,x) h = P/(2*pi); r = sqrt(x(1)^2+x(2)^2); gamma = atan2(x(2),x(1)); options = optimset('TolX',h*delta_s/100,'FunValCheck','on'); [sb,fval,exitflag] = fzero(@(sb) PIfun(r,R,h,gamma,x(3),sb),... [(x(3)-h*pi)/h,x(3)/h],options); if exitflag ~=1, disp('Error: PI invalid'); end % note that beta=sb in Kyle's formula alphaX = atan(r*sin(gamma-sb)/(R - r*cos(gamma-sb))); st = sb + pi -...

Errors when integrating MatLab code into C# program
Hello, I'm trying to learn how to integrate MatLab code into C#. I'm using Matlab R2010a and Visual Studio 2010. I downloaded the following tutorial and executed the MatLab side of the code: http://www.mathworks.se/matlabcentral/fileexchange/12987 However, when I tried to compile the C# code in visual studio, I got the following error: Could not load file or assembly 'MWArray, Version=2.9.1.0, Culture=neutral, PublicKeyToken=e1d84a0da19db86f' or one of its dependencies. The system cannot find the file specified. A quick google search led me to this page, which instructed me to change the target processor to x86: http://www.mathworks.com/support/solutions/en/data/1-B0JOFC/index.html?solution=1-B0JOFC However, as soon as I did so, I received a new error: System.BadImageFormatException was unhandled Message="Could not load file or assembly 'MWArray, Version=2.0.0.0, Culture=neutral, PublicKeyToken=e1d84a0da19db86f' or one of its dependencies. An attempt was made to load a program with an incorrect format." Another google search led me to this page, which said that components generated by MatLab builder x86 are not supported on x64 machines: http://www.mathworks.com/support/solutions/en/data/1-7457HL/index.html?product=MN&solution=1-7457HL My MatLab version is 64 bit, but I am still encountering this problem. Is there a workaround? HI, I am trying something similar to what you did, but with matlab 20...

Matlab engine with matlab R2010b
Hello All, I'm working with an aplication that use the matlab engine. I made the C++ program and it is working well in my pc with matlab 2007b, but the same very basic program shows an error when I tried to compile it in a pc with matlab R2010b. The error is about the icuuc32.dll. ¿Why is asking this DLL? How can I solve this?. Thanks¡ ...

What is the best way to import Excel files, with stock data, into Matlab? I’m using Matlab R2010b (64-bit)
What is the best way to import Excel files, with stock data, into Matlab? I’m using Matlab R2010b (64-bit) I’m trying to import historical prices of stock data. Matlab keeps cutting off the header of each column; it gives me only values. I am thinking that this is a data-type-mixing-issue, or whatever it’s called. I have ‘Dates’ in ColumnA, and ‘MSFT’, ‘PWER’, ‘KO’, and ‘SBUX’, in ColumnB-ColumnE. Basically, if I put the Excel file in my Matlab folder and double-click the file, I see the values in a matrix (no dates and no headers), I hit ‘Next’. Then, I see only one option; one radio button is enabled – ‘Create variable matching preview’. The other two options, ‘Create vectors from each column using column names’ and ‘Create vectors from each row using row names’ – both are greyed out. I’ve seen videos, on YouTube and on the Matlab site, where people import excel data and these options are NOT greyed out. No matter what I do, there options are ALWAYS greyed out. The problem is, when I click ‘Finish’ in my ‘Workspace’ I have a variable named ‘data’ all values in a 575x4 matrix, but I have NO DATES and I have NO HEADERS on the columns. All of this seems to go into another variable, called ‘textdata’; all dates and headers ate in textdata. This is VERY inconvenient. I’m trying to analyze some stock data and I have no headers, so I have no idea which stock is which (I can figure it out, but I think Matlab should do this for me). Also, I have no dates corresponding to ...

matlab C#
------------------------------------------------------------------------ Segmentation violation detected at Fri Mar 09 09:32:14 2012 ------------------------------------------------------------------------ Configuration: MATLAB Version: 7.0.0.19920 (R14) Operating System: Microsoft Windows XP Window System: Version 6.1 (Build 7600) Processor ID: x86 Family 6 Model 7 Stepping 10, GenuineIntel Virtual Machine: Java is not enabled Default Charset: ibm-1386_P100-2002 Register State: EAX = 00000001 EBX = 011c1bd8 ECX = 011c1bd8 EDX = 77346194 ESI = 00000000 EDI = 00000000 EBP = 053cf198 ESP = 053cf190 EIP = 78215da8 FLG = 00010202 Stack Trace: [0] jvm.dll:0x78215da8(0x011c1bd8, 0x781d019e, 0x79b67568 "e:\MATLAB7/sys/java /jre/win32/jr..", 8) [1] jvm.dll:0x781cdfa0(0x053cfa9c, 0x79b67568 "e:\MATLAB7/sys/java/jre/win32/j r..", 0x7c3428cf, 0x053cfac4) [2] jvm.dll:0x7817ac0b(0x79b66d30, 0x053cfac0, 0x053cfa9c, 0x7c3536ed) [3] jmi.dll:struct JNIEnv_ * __cdecl InitSunVM(bool)(0, 0x79b5e804 "MATLAB_JDB ", 0x053cfae0, 0x50000000) + 941 bytes [4] jmi.dll:_InitJava(0, 0x793069ed, 0, 0) + 77 bytes [5] jmi.dll:_mljInit(0x04508770, 1, 0, 0) + 6 bytes [6] mcr.dll:unsigned long __cdecl run_init_and_handle_events(void *)(1895368, 0x053cfdc8, 0x7735b299, 1895368) + 47 bytes [7] KERNEL32.dll:0x77491114(1895368, 0x7236b879, 0, 0) [8] ntdll.dll:0x7735b299(0x79306bd0, 18953...

Matlab problem!!
Dear All I hope that you are doing well and everything is OK. I have a question, please: I have a decimal number stored in a matrix. For example, Matrix subscripts: 1 2 3 5 6 7 8 9 10 Values: 8 9 8 7 7 9 9 2 7 So, the number is: 898779927 My matrix consists of 3000 cells and each cell contains a number from 0-9. I need to get the number of bits for this string in binary. However, I cannot convert it to binary as the program will give me out of range. Thanks and your response will be much appreciated. Sincerely, Kal kal wrote: > Dear All > I hope that you are doing well and everything is OK. > I have a question, please: > I have a decimal number stored in a matrix. For example, > Matrix subscripts: 1 2 3 5 6 7 8 9 > 10 > Values: 8 9 8 7 7 9 9 2 > 7 > So, the number is: 898779927 > My matrix consists of 3000 cells and each cell contains a number from > 0-9. I need to get the number of bits for this string in binary. > However, I cannot convert it to binary as the program will give me out > of range. > Thanks and your response will be much appreciated. I don't ordinarily do other's homework, but in the spirit of the season, I'll meet you more than half way. If you get "Out of range", then you're converting the wrong item. The correct answer is 30. D...

matlab and c#
hello, can anyone tell me how to connect between matlab and c#? is it using COM? or how? and it is done in c# or matlab or both? can anybody help me pls Thanx, Victor Search for "c sharp" on the MathWorks support page. Stuart "victor hugo" <dvictor_hugo@yahoo.com> wrote in message news:eee4ca3.-1@webx.raydaftYaTP... > hello, > > can anyone tell me how to connect between matlab and c#? is it using > COM? or how? and it is done in c# or matlab or both? > > can anybody help me pls > > Thanx, > > Victor ...

problem in matlab
Hello everybody . I have MAT LAB 2009 version software but it doesn't work properly in my system because in my system the RAM is 512 MB . when i started MAT LAB it takes lot of time in processing . Please any one provide me Mat lab software which is compatible to my system. On 1/4/2012 11:41 PM, siddhartha chandel wrote: > Hello everybody . I have MAT LAB 2009 version software but it doesn't work properly in my system >because in my system the RAM is 512 MB . when i started MAT LAB it >takes lot of time in processing . Please any one provide me Mat lab software which is compatible to my system. hi; First it is called Matlab (one word). As for the problem you are having, I do not think Mathworks makes a light version of Matlab, so only think I can suggest is to see if you can buy a little bit more RAM for your PC to make it run faster. "siddhartha chandel" <raman007.ec@gmail.com> wrote in message news:je3d5k$91m$1@newscl01ah.mathworks.com... > Hello everybody . I have MAT LAB 2009 version software but it doesn't work > properly in my system because in my system the RAM is 512 MB . when i > started MAT LAB it takes lot of time in processing . Please any one > provide me Mat lab software which is compatible to my system. For releases R2009a and R2009b, the bare minimum requirement given in the system requirements for running MATLAB on a 32-bit system is 512 MB of memory, while 1024 MB is recommended. [If you'...

Problem accessing Excel 2010 data with Matlab 2009b on Windows 7
We have a program written in Matlab that accesses data from an Excel spreadsheet. The system we have been using is XP Professional with Office 2003 and Matlab 2009b. The function used to read the data is ddereq(). A PC running W7 with Office 2003 continues to process the data from our Excel 2003 spreadsheets, but the machine running W7 with Office 2010 will no longer read data from our 2003 spreadsheets, nor from 2010 spreadsheets when the 2003 spreadsheet is duplicated as a 2010 spreadsheet. Could anyone suggest a workaround or solution to this problem? Regards, Kevin "Kevin Ginns" <kevin.ginns@gl-group.com> wrote in message news:je6ghj$frn$1@newscl01ah.mathworks.com... > We have a program written in Matlab that accesses data from an Excel > spreadsheet. The system we have been using is XP Professional with Office > 2003 and Matlab 2009b. > The function used to read the data is ddereq(). A PC running W7 with > Office 2003 continues to process the data from our Excel 2003 > spreadsheets, but the machine running W7 with Office 2010 will no longer > read data from our 2003 spreadsheets, nor from 2010 spreadsheets when the > 2003 spreadsheet is duplicated as a 2010 spreadsheet. > Could anyone suggest a workaround or solution to this problem? Instead of using the (rather old) Dynamic Data Exchange functionality, which hasn't changed in a very long time: http://www.mathworks.com/help/techdoc/rn/bq80uxu-1.html#bq87s...

Problems with calling a function from a MATLAB generated dll in c# with matrices as input arguments.
Sorry, there happend something with the subject of my last posting Hi everyone There is this wonderful solution of how to call a function from MATLAB generated dll which I found on <http://www.mathworks.com/support/solutions/data/1-X1PFC.html> It works fine. My problem is now how to call a function (from a MATLAB generated dll) which has a Matrix as In- and Output argument (and not a scalar). Has anyone already experienced with that? I googled a lot, but I could not find anything. Thanks in Advance. Michael P.S. I am using MATLAB Compiler Version 4.0 ...

Audio compression with matlab vs c/c++ ?
Hi 1. what are the advantages of develop audio compression (G711/729/...) in MATLAB instead of develop it in C/C++ ? 2. I saw a lot of implementations of audio compression in C/C++ and not in MATLAB , Is there a reason ? > > 1. what are the advantages of develop audio compression (G711/729/...) in MATLAB instead of develop it in C/C++ ? Development speed. > > 2. I saw a lot of implementations of audio compression in C/C++ and not in MATLAB , Is there a reason ? Running speed, and portability. Bruno Hi when you mention development speed and running speed, you mean that in Matlab it is faster than C/C++ ? Can you explain why ? "amit liron" wrote in message <jg14qu$g11$1@newscl01ah.mathworks.com>... > Hi > > when you mention development speed and running speed, you mean that in Matlab it is faster than C/C++ ? No, the opposite. I answered in the right order the two questions. > Can you explain why ? Bruno Thank's again the last Q :-) why and when should I use matlab ? "amit liron" wrote in message <jg1ge6$is9$1@newscl01ah.mathworks.com>... > Thank's again > > the last Q :-) > why and when should I use matlab ? All depend on your skill of both languages. For me, all the time, until I'm sure about the algorithm will work, then implement it in C/C++ if I need speed. Bruno ...

how to programming Matlab api Engine programming with Csharp
thank you first there are some resources about Matlab API engine programming with csharp? waiting for your reply! yours:king ...

US-MA-Natick: Developer, C++, C, XML, Java, MATLAB, Simulink, CAD tools; C-P (45307257608)
US-MA-Natick: Developer, C++, C, XML, Java, MATLAB, Simulink, CAD tools; C-P (45307257608) ========================================================================================== Position: Developer Reference: SMC01487 Location: Natick MA Duration: C-P Skills: 3+yrs of software engineering with strong C++, C, XML, and Java programming skills. Experience with MATLAB and Simulink. Knowledge in simulation algorithms and engineering systems. Experience with engineering simulation and CAD tools Please send your current resume in confidence to <staffing@eurosoft-inc.com> ..45307257608. ...

QR Decomp RLS
Hello, Anyone know where I might find this? Michael. Hi Michael Simon Haykins Book "Adaptive Filter Theory" comes with qrdrls matlab code on the CD. regards alain M. Wirtzfeld wrote: > Hello, > > Anyone know where I might find this? > > > Michael. > > ...

QR Decomp RLS
Hello, Anyone know where I might find this? Michael. ...

Optimisation problem in Matlab
Hey, Could some one please help me to find the errors in my m-files. thank, Marianne these are my matlab files and slm referes to simulink model that I mad: % This matlab script is used to call the constrained optimization routine % and solve the problem. % Defines the final time Tfinal=2; % Defines the integration step h=0.05; %computes the number of steps in the simulation N=Tfinal/h; % Defines the initial guess for the input %trajectory x0= zeros(N,1); %Defines the upper bound for the decision variables Xmax=10* ones(N,1); % Defines the lower bound for the decision variables Xmin=-10*ones(N,1); % Defines the optimization options, including the tolerance on the decision % vector 'TolX' and the tolerance on the function values 'TolFun'. % These Tolerances are used to determine the convergence of the % optimization algorithm. options=optimset('LargeScale', 'off',Display','iter',TolX,0.001,'TolFun',0.001); % Calls the 'fmincon' function to solve the optimization problem and stores % the optimal decision vector in X. X= fmincon ('obj_fun',x0,[],[],[],[],[],xmin,xmax,'con_fun',options,h,Tfinal); % Defines a time vector T. T=[0:h:Tfinal-h]'; % Defines an input vector for the simulation, including time. TU=[T x]; %defines the simulation options opt=simset('solver','ode5','SrcWorkspace','Current','Fixedstep',h); % Carries...

data programming problem
Hi, I have a challenging data programming problem that I can’t wrap my head around. I have a daily exposure data for 10 years (woodsmoke presence is 1/0 or missing) and I have an individual exposure file with individual IDs, period (s) of exposure (start/end) and weather or not the person was in an area with woodsmoke exposure: DATE WOOD 01/01/1994 0 01/02/1994 0 01/03/1994 1 01/04/1994 0 01/05/1994 1 01/06/1994 1 01/07/1994 1 01/08/1994 1 01/09/1994 0 01/10/1994 1 01/11/1994 0 01/12/1994 0 01/13/1994 0 01/14/1994 0 01/15/1994 0 ...

problem with parallel matlab
for i=1:size(APLocation,1) point=APLocation(i,:); parfor j=1:length (RXpoint) rssi(i,j) = LOSS(point,RXpoint(:,j)'); %%rssi having the signal strength from all AP's end end when i'm running the following code, i get the same value for each element of rssi (serially i get different results) where is my problem? Creating some fake data and and implementing a simple LOSS function, I do not see a different between the serial and parallel execution. Does LOSS use any persistent or global variables? function [ rssi rssi2 ] = foo APLocation = rand(10); RXpoint = rand(10) * 5; for i=1:size(APLocation,1) point=APLocation(i,:); parfor j=1:length (RXpoint) rssi(i,j) = LOSS(point,RXpoint(:,j)'); end end for i=1:size(APLocation,1) point=APLocation(i,:); for j=1:length (RXpoint) rssi2(i,j) = LOSS(point,RXpoint(:,j)'); end end end function rv = LOSS( a,b ) rv = sum( a+b ); end "michael" <bezenchu@gmail.com> wrote in message news:ht0t0k$fce$1@fred.mathworks.com... > for i=1:size(APLocation,1) > point=APLocation(i,:); > parfor j=1:length (RXpoint) > rssi(i,j) = LOSS(point,RXpoint(:,j)'); %%rssi having the signal > strength from all AP's > end > end > > when i'm running the following code, i get the same value for each element ...

A hard problem in matlab
passing gradient when using fminunc I am trying to make use of the gradient of the function and then minimize using fminunc in an unconstrained problem. I have done as specified by the help file (incorporating optimset and all that) but an error is being generated. If i don't pass the gradient it find the minimum using a line search instead of trust region method. I list the error message below. Any help is appreciated. function[f,g]=3Dexam1(x) %r=3D10=E5=BC=80=E5=A7=8B; M=3D10; r=3D1000000; f=3Dlog(x(1))-x(2)+r*((-x(1)+1+abs(-x(1)+1))/2)^2+r*(x(1)^2+x(2)^2-4)^2; %g(1)=3Ddiff(f,x(1)); %g(2)=3Ddiff(f,x(2)); g(1)=3D1/x(1)+r*2*(-1/2*x(1)+1+1/2*abs(x(1)-2))*(-1/2+1/2*sign(x-2)) +r*2*(x(1)^2+x(2)^2-4)*2*x(1); g(2)=3D-1+r*2*(x(1)^2+x(2)^2-4)*2*x(2); >> options=3Doptimset('GradObj','on');[x,fval]=3Dfminunc('exam1',[1;0],opti= ons) ??? In an assignment A(I) =3D B, the number of elements in B and I must be the same. Error in =3D=3D> exam1 at 8 g(1)=3D1/x(1)+r*2*(-1/2*x(1)+1+1/2*abs(x(1)-2))*(-1/2+1/2*sign(x-2)) +r*2*(x(1)^2+x(2)^2-4)*2*x(1); Error in =3D=3D> fminunc at 220 [f,GRAD(:)] =3D feval(funfcn{3},x,varargin{:}); >> On 5/5/2012 9:52 AM, wangbin123ab@126.com wrote: .... > ??? In an assignment A(I) = B, the number of elements in B and > I must be the same. > > Error in ==> exam1 at 8 > g(1)=1/x(1)+r*2*(-1/2*x(1)+1+1/2*abs(x(1)-2))*(-1/2+1/2*sign(x-2)) ...

Web resources about - problems getting MATLAB data in C++ program - comp.soft-sys.matlab

Is–ought problem - Wikipedia, the free encyclopedia
The is–ought problem in meta-ethics as articulated by Scottish philosopher and historian David Hume (1711–76) is that many writers make claims ...

Poorly behaved app causing crashes and link problems for some iOS 9.x users
Enlarge / The good news is that not all iOS 9 users are affected by this bug! The bad news is that if you are affected, you might be stuck waiting ...

Volkswagen e-Golf recalled for battery software problem
Filed under: Green , Recalls , Volkswagen , Safety , Hatchback , Electric Volkswagen will recall the 2015-2016 e-Golf to fix the electric motor ...

Pandora Drops 9%: FBR Defends Value, Axiom Sees Admission of Problems
Shares of online streaming radio pioneers Pandora Media ( P ) are down $1.06, or almost 10%, at $9.87, after the company this morning said founder ...

"All we need to do is change our 'frame' for terrorism and start treating it as a medical problem."
... terribly unfair – just to avoid contact with the 1% who might be infected with the radical islamic terror virus. Trump is approaching the problem ...

Microsoft's HoloLens has a surprising heat problem
The Microsoft HoloLens holographic goggles may not be comfortable to wear for long periods of time, warns game developer David Dedeine in an ...

The new iPhone has a China problem
The jury is out on pre-orders of the iPhone SE in China, but smugglers already have their doubts.

Chevrolet recalls new Malibu for a different kind of Takata problem
It's not related to the forward airbag inflator, but the issue is no less serious.

WH: Republicans' Rhetoric 'A Significant Problem' for Obama, Who's 'On the Hook' for Nat'l Security
"Their (Republicans') rhetoric is also counterproductive when it comes to protecting the American people. And that's a significant problem, particularly ...

Hillary Clinton Credits GOP Extremism With Their Trump Problem
In a speech to law students in Madison earlier this afternoon, Hillary Clinton made her strongest statements yet about the racism and extremism ...

Resources last updated: 3/30/2016 3:07:56 PM