f



Passing Mask Parameter to C-mex S Function

Hallo,

i have several C-mex S-Functions to which i would like to make ONE mask Block so that i cann enter the name and the parameters of the S-function on the mask dialogbox. So How can i pass the name and the parameters of the s-function from the mask into the s-function block? 

Thanks in advance!!
Ali 
0
4/13/2012 2:28:18 PM
comp.soft-sys.matlab 211264 articles. 25 followers. lunamoonmoon (257) is leader. Post Follow

0 Replies
951 Views

Similar Articles

[PageSpeed] 51

Reply:

Similar Artilces:

C-mex S-function: nested functions of different typecast
I am trying to create an C-mex S-function with an additional nested function. However, I am having a hard time with all the different pointers and typecasts. Help would be very much appreciated :). Question: Does anyone notice strange type conversions in the code below? The compiler does not complain, but Simulink crashes with a fatal error. static void mdlOutputs(SimStruct *S, int_T tid) { void evaluatespline_1p(double *, double *, const double *, const double *, double *, double *); .... const real_T* Cx = ssGetInputPortRealSignal(S,0); const real_T *Cy = ssGetInputPortRealSignal(S,1); ..... real_T *sr0_norm = ssGetOutputPortSignal(S,1); real_T *Srf = ssGetOutputPortSignal(S,3); .... double teta[4]; double dteta[4]; ..... evaluatespline_1p(sr0_norm, Srf, Cx, Cy, teta, dteta); ..... void evaluatespline_1p(sr,Srf,Cx,Cy,teta,dteta) double *sr[4]; double *Srf; double *Cx[NR_C]; double *Cy[NR_C]; double *teta[4]; double *dteta[4]; { a lot of stuff to calculate the output values for teta and dteta: *teta[k]=atan(dY/dX); *dteta[k]=((dX*ddY-dY*ddX)/(dX*dX+dY*dY))*(NR_C-3)/(*Srf); } ...

MATLAB's SOUND() function in C
Is there a way to implement MATLAB's sound function under C? For those who don't use MATLAB, it's essentially a simplistic, static, mono sound function that converts a series a numbers into a sound at a given sampling rate. nothing fancy. all the Sound APIs begin by discussing all the fancy drivers and buffers and crazy shit i don't really care about. Thanks. In article <1151779016.882805.282580@d56g2000cwd.googlegroups.com>, sluox@yahoo.com wrote: > Is there a way to implement MATLAB's sound function under C? > > For those who don't use MATLAB, it's essentially a simplistic, static, > mono sound function that converts a series a numbers into a sound at a > given sampling rate. nothing fancy. all the Sound APIs begin by > discussing all the fancy drivers and buffers and crazy shit i don't > really care about. > > Thanks. The basic thing to do is: - SndNewChannel - SndDoCommand to send a bufferCommand - SndDisposeChannel If you intend to play the sound asynchronously, be careful to not dispose the sound channel or the buffer you play before the sound has finished playing (install a callback using SndDoCommand, if you want to be informed when that is) For more info, take a look at the function SndSnip_PlaySoundResourceUsingBufferCmds in SoundSnippets.c (<http://developer.apple.com/samplecode/soundsnippets/listing1.html>). Reinder Reinder Ver...

passing variables between c mex function and predefined subroutine
Hello, I'm new in programming c mex function and I must have done something illegal in passing variables between my mex function and a predefined subroutine. The code regarding the variable passing is pasted below. I was able to compile it quietly but got a segmentation error when I run it. Could anyone please tell me what are wrong in my code? Thank you so much in advance! //predefined subroutine void myfunc(float *disc_score_pos_M1, float *disc_score_neg_M1, float *disc_score_pos_M2, float *disc_score_neg_M2,int M, int N, float *az1, float *az2, float ***cov_mat) { .... } void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) { float *disc_score_pos_M1, *disc_score_neg_M1, *disc_score_pos_M2, *disc_score_neg_M2; mwSize mrows,ncols; int M, N; float *az1,*az2,***cov_mat; /* Check for proper number of arguments. */ if(nrhs!=4) { mexErrMsgTxt("Four input arguments required."); } else if(nlhs>3) { mexErrMsgTxt("Too many output arguments"); } /* The input must be four noncomplex double column vector.*/ mrows = mxGetM(prhs[0]); ncols = mxGetN(prhs[0]); if( !mxIsDouble(prhs[0]) || mxIsComplex(prhs[0]) || !(mrows==1 || ncols==1) ) { mexErrMsgTxt("Input must be noncomplex vectors."); } M=mxGetM(prhs[0]); N=mxGetM(prhs[1]); /* Create matrix for the return argument. */ plhs[0] = mxCreateDoubleMatrix(1,1, mxREAL); ...

difference between c mex and m -file for s function
hello, I have a s-function that composed by the m-file method, but the excuation time is too long for the real-time simulation. Thus I converted the s-function from m-file to c-mex method. Then,I use these two methods(m&c) to construct s-functions respectively at a simulink model, and these two s-functions will generate two curves,I try to make this two curves match completely to confirm if the c-mex code is correct, but this two simulation curves(m&c) are identical nearly, not match completely.The solver is ode2 and sample time is about 0.05ms, could you give me so idea or suggest? thanks a lot.... Eric ...

How to measure real time in c-mex s-functions?
I’m developing a c-mex s-function that, once compiled into a .mexw32 file, will call functions from a library (.lib) file and a .dll . These functions control a series of dynamic movements; each movement takes ~5-10 seconds of real-time to run. The controller functions within the .lib and .dll were trained to function properly for only the first 2 seconds of each movement; after 2 seconds, I need to switch control over to another controller. However, I’m trying to determine *how*, within my c-mex s-function code, I can access the system-time, so that I can have an objective measure of when the first 2 seconds have passed for each movement. In case it’s relevant, the c-mex s-function code corresponds to a block within my Simulink model; the .mexw32 file begins running once the Simulink model has started to run. However, referring to the Simulink model time doesn’t seem useful; even though my system runs a total of 5 movements, each of which visually (via animation) takes ~5-10 seconds to execute, the Simulink system time shows only ~1.5 seconds passing per movement (and the specific amount of time per movment may be variable; I’m not sure). In regular C code, I would do the following to gauge time: time_t clockstart; clockstart = clock(); cputime = (double) (clock()-clockstart)/CLOCKS_PER_SEC; However, if I even try to introduce the first line of code above into my c-mex s-function code, I get a compile error. Doing a search for “c-mex s-function time” or “m...

KIND parameter type mismatch when pass to C function
Here is the problem that I have. The double in C is interoperated with REAL(c_double) in Fortran. There is no concept of KIND parameter in C. However, in Fortran, I have a double precision data, that I defined with a given precision via the KIND parameter integer :: dp = selected_real_kind(P=15) real(KIND=dp) :: my_array When I try to pass my_array to the C function calling vis iso_c_binding, I get a "type mismatch" error, as the parameter in the C function is int c_func( double * arr, int size) andd its interface in Fortran is interface integer(c_int) c_func(arr, size) bind(C) real(c_double) :: arr integer(c_int), value:: size end end interface Could someone give me a resolution for this. Do I have to define a new variable of type real(c_double) :: tmp, and then make a copy of the original data tmp = my_array before passing tmp to the function. I actually, dont want to do this at all, as the data my_array is quite large. Thanks, Tuan "bio_amateur" <hoangtrongminhtuan@gmail.com> wrote in message news:86d04906-8ffd-43a2-8279-edf21e6ea327@a11g2000vbn.googlegroups.com... > interface > integer(c_int) c_func(arr, size) bind(C) > real(c_double) :: arr > integer(c_int), value:: size > end > end interface > Could someone give me a resolution for this. First thing I would try is to replace the line: real(c_double) :: arr with: real(...

[Question] parameter passing between C and C++
Hi, everyone! We are developing an application using both C and C++. We have defined a structure in a C program as follows: typedef struct node { struct node *next; int value; }List; And we construct a linked list using the above structure. Then we pass the linked list to a function which is defined in a C++ program enclosed with "extern "C" { }". e.g.) IN C-program typedef struct node { struct node *next; int value; }List; int main(){ List *l; /* l is initialized */ function_in_cpp(l); } IN C++-program extern "C" { typedef struct node { struct node *next; int value; }List; function_in_cpp(List *l) { .... } } When the length of a linked list is 1, the function call to a function in a C++ is successful. However, when we call the function in C++ program with the linked list whose length is 2, the actual parameter in the C++ program is NULL. So, we can't pass the desired value to a function in the C++ program. Is there any difference between C and C++ in representing a "struct" type variable? If any, the difference results in the consequence? Please anybody help me. Thanks in advance "Seung-Uk Oh" <suoh@macroimpact.com> wrote... > We are developing an application using both C and C++. > We have defined a structure in a C program as follows: > > typedef struct node { > struct node *next; > int value; > }List; > >...

Modify tunable global parameters in 'C' S-Function
I am creating a Simulink model with a large number of parameters. I would like for the values of these parameters to be reconfigurable after deployment (i.e., after code generation and binary executable distribution) via a human-readable configuration file. My reasons for wanting to change these values in the field are due to changes in sensors and external environments as well as debugging in actual hardware. I have created a 'C' S-Function which parses my configuration file and auto-magically determines the names, types and values of the tunable parameters. My issue is with regards to getting these values into the model. I can dynamically create lots of output ports and use lots of data stores, but that method doesn't seem ideal. Is there a way that I can parse through existing Simulink model workspace parameters, compare them to config file parameters and set them? I also need to create the S-Function once and not have to modify it when additional parameters are added to the model / configuration file. I got something like 'mexEvalString("param = [1 2 3]");' to work in Simulation, but I can't generate code as long as that line is included (unspecified error). I suppose my questions are 3 fold: 1. Can I parse and modify global tunable Simulink parameters from within a C S-Function 2. Am I going about this the wrong way? What is standard practice for this type of thing? I've been searching quite a bit, but haven...

Error in compiling C++ S-Function with Visual C++
I have a Simulink model with an S-Function which implements, in C language, an algorithm for computing on complex numbers. Because C doesn't have complex numbers built-in manipulation instructions, simply I based the computing on the real-imag. decomposition of the numbers. The S-Function was compiled with lcc through the S-Function Builder, and there were no problems. Since this is a very uncomfortable solution, I decided to use C++ language with Microsoft Visual C++ 2005 Express Edition; the S-Function was still compiled fine. When I introduce the #include <complex> instruction (without changing the C code), I get the following message from the S-Function Builder: cancthrs_wrapper.c C:\Programmi\Microsoft Visual Studio 8\VC\INCLUDE\cmath(18) : error C2143: syntax error: '{' missing before ':' C:\Programmi\Microsoft Visual Studio 8\VC\INCLUDE\cmath(18) : error C2059: syntax error: ':' C:\Programmi\Microsoft Visual Studio 8\VC\INCLUDE\cmath(18) : error C2143: syntax error: '{' missing before ':' C:\Programmi\Microsoft Visual Studio 8\VC\INCLUDE\cmath(18) : error C2059: syntax error: ':' C:\Programmi\Microsoft Visual Studio 8\VC\INCLUDE\cmath(19) : error C2143: syntax error: '{' missing before ':' C:\Programmi\Microsoft Visual Studio 8\VC\INCLUDE\cmath(19) : error C2059: syntax error: ':' C:\Programmi\Microsoft Visual Studio 8\VC\INCLUDE\cmath(19) : error C2143: syntax error: '{' missin...

Visual C++ by-passed when debugging a c++ MEX-file
Hi all, I used matlab 2007b, vs2003 as compiler and debugger. I generated my dynamic library(filename.mexw32) for matlab from c++. It was 'mex -g' compiled successfully, from 2 cpp files and a couple of headers. I want to debug using visual studio 2003, I followed the instructions here. http://www.mathworks.com/support/solutions/data/1-1BUHC.html?solution=1-1BUHC However, every time I set up the breakpoint and debug (F5) from VS2003, the matlab 2007b got launched and vs2003 (strangely) went out of debug mode. If I ran matlab routine to call the mexw32' library, it won't stop at my breakpoint. This 2007b+vs2003.net method worked fine before, to other projects (all of which contains only one source code file). I suspect this must have to do with the project settings. But I cannot seem to find out what is that. I used the same setting as those successful projects. Any help will be much appreciated. Thanks. Hello, I had this problem and finally I remarked there are two matlab.exe. One in C:\Program Files\MATLAB\R2007b\bin and the other in C:\Program Files\MATLAB\R2007b\bin\win32. When I configured my MSVC, I choosed the first one instead of the second one ... Maybe this is the key of your problem. Vanderbilt <shufei.fan@gmail.com> wrote in message <56b8a77e-f48b-4549-b2d4- e9561b6f20b8@u10g2000prn.googlegroups.com>... > Hi all, > > I used matlab 2007b, vs2003 as compiler and debugger. > I generated my dynamic library(filena...

passing a parameter to a function
I'm getting the error message that the parameter passed to the function is not a valid resource. The parameter is $result and it is from a query in a switch statement. What do I have to do to get it to accept it? tia, function MakeXclHeader($result){ $fields = mysql_num_fields($result); for ($i = 0; $i < $fields; $i++){ $header .= mysql_field_name($result, $i) ."\t"; } $header .= "\n"; return 1; } ---------------------------- switch ($_SESSION["LMS_USER_DESC"]){ case 'internal': $headers = GetHeaders($file_name); $result = SELECT_idle_days_lease($id, $days,CLM_order_by($order_by)); $lease_row = false; break; case 'owner': $headers = GetHeaders($file_name); $result = SELECT_idle_days_lease_owner($id, $days,CLM_order_by($order_by)); $lease_row = false; break; default: $headers = GetHeaders($file_name); $result = SELECT_idle_days_lease($id, $days,CLM_order_by($order_by)); $lease_row = false; break; } JRough wrote: > I'm getting the error message that the parameter passed to the > function is not a valid resource. The parameter is $result and it is > from a query in a switch statement. What do I have to do to get it to > accept it? > tia, > > function MakeXclHeader($result){ > $fields = mysql_num_fields($result); > for ($i = 0; $i < $fields; $i++){ > > $header .= mysql_field_name($result, $i) ."\t"; > } > $he...

Matlab S-function
I am trying to access element in a matrix. But it gives me an error message "Attempted to access xxx(0); index must be a positive integer or logical." The input to my s-function is a constant block with value of 1 and data type of uint16. Thus, my input is definitely a positive integer. I also tried to use "cast" to make sure my variable "var" is positive integer but it did not work. I have no idea why Simulink returns this error message. My very simple code is below. function setup(block) block.NumInputPorts = 1; block.NumOutputPorts = 1; block.SetPreCompInpPortInfoToDynamic; block.SetPreCompOutPortInfoToDynamic; block.InputPort(1).Dimensions = 1; block.OutputPort(1).Dimensions = 1; block.NumDialogPrms = 0; block.InputPort(1).DatatypeID = 5; % uint16 block.InputPort(1).Complexity = 'Real'; block.InputPort(1).DirectFeedthrough = false; % Override output port properties %block.OutputPort(1).Dimensions = 1; block.OutputPort(1).DatatypeID = 0; % double block.OutputPort(1).Complexity = 'Real'; % Register sample times block.SampleTimes = [-1 0]; % Specify the block simStateCompliance. block.SimStateCompliance = 'DefaultSimState'; % Register for all block methods block.RegBlockMethod('SetInputPortSamplingMode',@SetInpPortFrameData); block.RegBlockMethod('SetInputPortDimensions', @SetInpPortDims); block...

S-function! in Simulink/Matlab
Hello, S-function! in Simulink/Matlab does anyone solve ODE in S-function! in Simulink C++ blocks instead of matlab m-files? thanks ...

displaying a function passed as a parameter
Hi, I'm a newbie scheme programmer. I wonder if what I am trying to do is possible. I'm trying to write a simple unit test framework. Very noddy at the moment. This is my test function: (define (test-fun fun expected args) (if (eq? (apply fun args) expected) #f ( (display "TEST FAILED: (") (display fun) (display " ") (display args) (display ") ") (display expected) (display " )") (newline) (error "test failed") ))) When it fails I'd like it to print out the test that failed. If I call it like this (test-fun palindrome? #t '("Malayalam")) I get: TEST FAILED: (#<CLOSURE> (Malayalam)) #t ) Error: test failed The test fails due to a known bug in palindrome? (it expects case to match) but I'm interested in why I don't get: TEST FAILED: (palindrome? (Malayalam)) #t ) I'm using tinyscheme (I'm aware it isn't a full R5RS implementation -- Nick Keighley "To every complex problem there is a simple solution... and it is wrong." -- Turski On Sep 26, 4:42=A0pm, Nick Keighley <nick_keighley_nos...@hotmail.com> wrote: > > (test-fun palindrome? #t '("Malayalam")) > > I get: TEST FAILED: (#<CLOSURE> (Malayalam)) #t ) > Error: test failed > > The test fails due to a known bug in palindrome? (it expects case to > match) > but I'm intere...

Pass Parameter to Query using Function
Hi and TIA, I Have a query that uses a function for setting the Criteria. When I view the return value of the finction it appears to be exactly what I want for my criteria. The problem is if I type the criteia directly in the query all's well however if I set it to the return value of the function I get no records returned. I've used functions in query criteria before so I know it's possible, but for some reason it's not working. Here's the function I'm using. Any help is appreciated. Thanks! Option Explicit Const conRPoolCVN = """A"" Or ""B"" Or ""C"" Or ""D"" Or ""E"" Or ""F"" Or ""G"" Or ""H"" Or ""J""" Const conRPoolL = """A"" Or ""C"" Or ""D"" Or ""E"" Or ""H"" Or ""M"" Or ""U""" Const conAVDLRCVN = "<>""A"" And <>""B"" And <>""C"" And <>""D"" And <>""E"" And <>""F"" And <>""G"" And <>""H"" And <>""J""" Const conAVDLRL = "<>""A"" And <...

GNAT parameter passing, C-style?
Hi, I've just written a program to prove it, but am I correct in saying that the GNAT procedure/function calling mechanism is to pass parameters from right-to-left (C-style), rather than left-to-right (PASCAL-style)? I was also wondering if there is an Ada standard way to changing the mechanism? Or this compiler specific? Thanks, Luke. You're talking about the ordering of parameters as they are pushed on the stack? I know of no mechanism to control that in the Ada standard and I doubt that the standard could possibly specify anything that is such a low level implementation detail. What about machines with large register sets? Compilers would want to optimize by putting parameters in registers and that might mess up the order you think you're getting. Different platforms will have different parameter passing mechanisms and conventions. What you refer to as "C-Style" and "Pascal-Style" is probably misleading as well. What C compiler on what platform? Likewise for Pascal? AFAIK, there is no requirement in C or Pascal to use any particular mechanisms for parameter passing (beyond C allowing you to specify that something should live in a register.) If you had two different compiler writers working on two different platforms, you'd likely get two different mechanisms for parameter passing. Should the stack pointer increment or decrement as it puts items on the stack? It depends - what's the convention on the processor, OS...

How to pass a structure out of a C MEX-File?
I want that the second output argument of a C MEX-File be a Matlab structure. I didn't find a convenient example, so I want to ask if my way is correct: - First I create a simple structure by calling plhs[1] = mxCreateStructMatrix (1, 1, 7, nom); where 'nom' is an array of 7 char*. - Then I fill the fields (for example "time") with a vector: I create it by temp = mxCreateDoubleMatrix(1, length, mxREAL); Where temp is a temporary variable of type mxArray*. Then I have to set its real data but my original C-array has been allocated by malloc. So I create a new C-array with mxMalloc and I copy the first one in this one with a for-loop. Once I have the new allocated C-array x, I call: mxSetPr (temp, x); I have now a Matlab array I want to link with my structure. I do it by : mxSetField (plhs[1], 0, "time", temp); I can now deallocate my original C-array without risks. Is it correct ? thank you for your help. Frederic Sicot "Frederic Sicot" <frederic.sicot@etienne-lacroix.com> wrote in message news:a5961a70.0401050722.7ecee53c@posting.google.com... > I want that the second output argument of a C MEX-File be a Matlab > structure. I didn't find a convenient example, so I want to ask if my > way is correct: > - First I create a simple structure by calling plhs[1] = > mxCreateStructMatrix (1, 1, 7, nom); where 'nom' is an array of 7 > char*. > - Then I fill the fields (...

passing array to a function as a single parameter
Hi all how can you pass an array to a function as a single parameter? regards Marc Hi, > how can you pass an array to a function as a single parameter? <?php function getArray($arr) { print_r($arr); } $my_array = array(1,2,3,4,5); getArray($my_array); .... it that was what you asked for. ...

problem in passing parameter to dll function
i am coding a dll which contains a function take a const wchar_t* as parameter, call it form a exe, the wchar_t is passed to dll function, but the function in dll will then call another function and pass that wchar_t* parameter to another function, now the problem is that functions in dll, when exported function pass parameter another one(unexported), they both residen in the same dll, between wchar_t* passing, the target function can't get the expected wchar_t*, but the string len is correct, could any who know how to fix it? thanks:) "andy" <admin0@optusnet.com.au> wrote in message: > i am coding a dll which contains a function take a const wchar_t* as > parameter, call it form a exe, the wchar_t is passed to dll function, > but the function in dll will then call another function and pass that > wchar_t* parameter to another function, now the problem is that > functions in dll, when exported function pass parameter another > one(unexported), they both residen in the same dll, between wchar_t* > passing, the target function can't get the expected wchar_t*, but the > string len is correct, could any who know how to fix it? thanks:) It's impossible to answer your question or even judge whether it is appropriate for this group because the way you have tried to explain it doesn't make sense. Can you try to state your problem more clearly? Please use the simplest example that produces the problem. Jonathan >...

How to implement Matlab fir1 function in C?
Hi all, In Matlab, we use fir1 function to calculate fir filter coefficients. For example, fir1(10,0.375) Outputs are: ans = Columns 1 through 10 -0.0019 -0.0133 -0.0161 0.0766 0.2677 0.3742 0.2677 0.0766 -0.0161 -0.0133 Column 11 -0.0019 I wonder how it works and how to implement the fir1(n, wn) function in C programming language. Thanks a lot! Please help! Jedora. "Jedora" <jedora@gmail.com> wrote in message news:1180363763.385273.280640@o11g2000prd.googlegroups.com... > Hi all, > > In Matlab, we use fir1 function to calculate fir filter coefficients. > For example, > > fir1(10,0.375) > > Outputs are: > ans = > > Columns 1 through 10 > > -0.0019 -0.0133 -0.0161 0.0766 0.2677 0.3742 > 0.2677 0.0766 -0.0161 -0.0133 > > Column 11 > > -0.0019 > > I wonder how it works and how to implement the fir1(n, wn) function in > C programming language. > Thanks a lot! > Please help! > > Jedora. Get Jake Janovetz' C code for the Parks-McClellan program and modify as you desire for things like I/O, etc. Fred Fred Marshall wrote: > "Jedora" <jedora@gmail.com> wrote in message > news:1180363763.385273.280640@o11g2000prd.googlegroups.com... >> Hi all, >> >> In Matlab, we use fir1 function to calculate fir filter coefficients. >> For example, >> >> fir1(10,0.375) >&...

Passing the array parameter to .Net function
Hello, this has to be simple... I am trying to pass a two dimensional array to a function in DLL that I created in vb.net. I can pass and get values for integer, string or even one dimensional array variables, but I can't get two dimensional array to work. I am declaring an Array and filling it like this: local b := Array( 2, 2) b[1,1] = "1.1" b[1,2] = "1.2" b[2,1] = "2.1" b[2,2] = "2.2" Then I call my dll with: dll := CreateObject( "ProgID_of_MyDLL" ) returnValue1 := dll:fTestArray2d(b) alert(valtoprg(returnValue1)) The DLL function is plain simple... Public Function fTestArr2d(ByVal arr(,) As String) As String(,) return arr End Function And the error I am getting is: "Error ProgID_of_MyDLL1/0 S_OK: FTESTARRAY2D Arguments: ([1] = Type: A Val: {Array of 2 Items})" What am I doing wrong? Thanks in advance... Instead of thinking of a 2 dimensional arrays, you may test an Array of Arrays, or Array of Variants. "torclmo" <torclmo@gmail.com> wrote in message news:e40b7a1d-4b35-4f8d-a63f-4a8614f4975d@z41g2000yqz.googlegroups.com... > Hello, > > this has to be simple... I am trying to pass a two dimensional array > to a function in DLL that I created in vb.net. I can pass and get > values for integer, string or even one dimensional array variables, > but I can't get two dimensional array to work. I am declaring an Array > and filling ...

Function Parameter passing? Session? Static? Global?
Dear Newsgroupers, The 'main' page contains a call to a function in an included file. This function puts a html-form on the screen. Before the form gets posted (to the 'main' page) some prior errorchecking is done. The form fields are then sent and an object is created (all in the same function). What I need ( imo ) is an array with objects that can be written later to a dbfile to preserve. But I cannot find a solution for the extension of the array. the function statements are simply these: < inside function in included file > $o = someObject( $s ) ; $objarr[] = $o; </ inside function in included file > As this array is within a function it is local to this function. As I understand it now a good solution would be to pass the array to the function. In the 'main' page I made a variable $objarr that is passed into the function like this: <'main' page> $objarr ; function( $objarr ) </'main' page> The PHP manual states that in the absence of the array variable it gets created. {Does this mean that function( $objarr ) would suffice? } However, whatever I try, I end up with the creation of $objarr[ 0 ] only. Please advise TIA, pablo pablo wrote: > What I need ( imo ) is an array with objects that can be written later to a > dbfile to preserve. > > But I cannot find a solution for the extension of the array. > > the function statements are simply these: > > < inside function in in...

Pass arbitrary pointer type between mex functions
Hello, hopefully some of you will be able to shed some light on the problem. I'm trying to pass a user defined pointer type between calls to different mex functions in a Matlab script. More specifically, I have some custom hardware that is accessed over USB using an API written in C. In order to access the hardware, a pointer (of a user defined type) to a device handle is generated in C like this: usb_device_handle=open_usb_device(); I can then use this device handle to read 'Nbytes' amount of data from the USB device (again in C): usb_device_data=read_data_from_usb_device(usb_device_handle, Nbyts); I'd like to pass this device handle back to Matlab as an opaque type (with respect to Matlab) and then from Matlab pass the device handle to another mex function which performs other operations using the device. The problem is that Matlab only allows one to pass back types of MxArray. I've read about people using mxMalloc() and mexLock() to do these types of things... but I was wondering if there was a clean solution that I haven't considered. Again, the data type is completely opaque to Matlab, and I only intend to manipulate the pointer value in the C-code defined in the mex files. "Cody" wrote in message <jpjk4j$41m$1@newscl01ah.mathworks.com>... > Hello, hopefully some of you will be able to shed some light on the problem. I'm trying to pass a user defined pointer type between calls to different mex functions in a Ma...

Sajax: lost parameters passed to php function
Hi, i write an entire site using sajax and php and I found it very powerful and useful. But yesterday my client had formatted the ubuntu server and when server is come back online a strange thing happened. Sajax seems to work fine (i use the debug mode) while send parameters to the exported function but when the server function has been called the parameters sended by javascript are lose and the function receive the string "Array". I miss some php/apache module? Maybe some security module installed don't let pass the parameter? Any other idea are appreciated... Thanks MicKy This is my code: <?php require("include/Sajax.php"); function checkuser($usr) { //The paramenter $usr receive always the string "Array" $query="SELECT * FROM users WHERE username = '".$usr."'"; query($query,$res,$rows); if ($rows > 0) { // TODO: ... } } sajax_init(); //$sajax_debug_mode = 1; sajax_export("checkuser"); sajax_handle_client_request(); ?> <?php sajax_show_javascript(); ?> function do_check_ris(ris) { document.getElementById("ris").value = ris; } function do_check() { // get the folder name var usr; usr = document.getElementById("txtNick").value; x_checkuser(usr, do_check_ris); } </script> // form... <input name="txtNick" type="text" id="txtNick" /> <input type="button" name="check&qu...

Web resources about - Passing Mask Parameter to C-mex S Function - comp.soft-sys.matlab

Parameter - Wikipedia, the free encyclopedia
A parameter (from the Ancient Greek παρά , "para", meaning "beside, subsidiary" and μέτρον , "metron", meaning "measure"), in its common meaning, ...

fb_source Parameter - Facebook-Entwickler
This document lists the complete list of values for the fb_source parameter that is returned with th...

Google / Firefox Parameter - Flickr - Photo Sharing!
HS what? www.seroundtable.com/archives/017105.html

Cat 8: TIA performance standards committee chairman previews parameters of forthcoming twisted-pair cable ...
Category 8, the next-generation twisted-pair cabling specification, is still in development, but the outlook looks quite positive that it will ...

Philippine president asks for 'parameters' of Mayon Volcano tours
Philippine president asks for 'parameters' of Mayon Volcano tours People's Daily Online ... 26, 27, 28, 29, 30, 31. Jan, Feb, Mar, Apr, May, ...

Alternatives to boolean parameters
... ) { PrintLine ( item . Name ); if ( printDetails ) { PrintLine ( item . Description ); } } } Aha! Now can see that the boolean parameter ...

Exporting Error (Error in Parameter...: Apple Support Communities
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability ...

Apple tech monitors device aging, adjusts operating parameters to ensure optimal performance
... describing a method of monitoring the aging of a device's electronics, comparing the data with a global average and modifying operating parameters ...

Is it poor programming practice to pass parameters as objects?
... a free, community-powered network of 100+ Q&A sites . Risser asked: So, we've got a guy who likes to write methods that take Objects as parameters, ...

Parameter Short Film Competition sponsored by Grolsch
Grolsch presents Parameter The A.V. Club Short Film Competition Please Enter Your Date of Birth Ineligible entry Enter For people over the age ...

Resources last updated: 3/30/2016 1:00:24 PM