That was very helpful, Andreas -- thanks!!
Type: Posts; User: CodeRed
That was very helpful, Andreas -- thanks!!
I have a follow-up question concerning my use of 'char' as the return type for my fcn1Wrapper() call:
my main code is similar to this, assuming that the function declaration was performed in the...
Ok, thanks for that clarification.
Thanks for your advice, Codeplug; reverting to the original c-mex s-function code but just changing 'bool' to 'char', worked! The code now compiles and runs!
Update: Fyi, I found that if I include...
Thanks for the clarification, grumpy; I was aware that bool isn't a C type, but wasn't sure how to go about correcting for this. I'll have to look at the C++ code more closely to determine how...
Thanks for the elucidation, Codeplug. To clarify, I am using *gcc* to compile my *C* code. The functions that I want to access within my C code, are coded in C++, and saved in the .dll that I'm...
Thanks for your suggestion, iMalc; if I remove "extern "C"", now my compiler errors are the following:
line 33: error: expected declaration specifiers or '...' before '*' token
line 33: error:...
Thanks for your clarification, christop. I had suspected that "extern C" isn't valid C syntax, but am not sure how to proceed. My source code is written in C++, compiled into a .dll using Visual...
Thanks for your suggestion, Codeplug. I tried it out, but unfortunately, I still receive the same exact compiler error ("expected identified or '(' before string constant"). Any other suggestions...
Hi!
I’m attempting to translate currently-functional c-mex s-function code (from the Matlab platform) into regular C code. In that c-mex s-function code, the following sequence works to access...
You were right, rags... I had missed that fclose() was being called and *then* the conditional statement had been executing a second time. Problem solved, thanks for the suggestion.
No, as I mentioned, the file pointers that I've tried are all valid (i.e. they can all be used successfully before & after this new conditional, but not within it). But thanks for the suggestion.
In case it's useful: the new conditional statement that's causing problems, was copied verbatim from an earlier code version that ran perfectly. I was careful to declare all variables & file pointers...
I use fprintf() calls throughout a particular function. Most of them cause no problems & behave as expected. However, I've just added a conditional statement within this function, and any fprintf()...
laserlight: No, I was referring to 2 separate entities -- the macro was one problem, and the int variable was a separate issue.
Update: I resolved both of the problems that I described above! It...
Thanks for your input. You're right, I created some simple code, and my macro prints fine as an int. I also just discovered that another int value that I have, which only ever has the values of 0...
I have a macro defined:
#define MYMACRO 5
and all I'm trying to do is print its value to the screen (I'm debugging and need to see all values that are part of a particular calculation). I've...
Thanks for the input, G. Sorry I forgot to include the fclose() in my pseudocode above; it *is* included in my real code. You're correct that the "%lf" was necessary to read in the double values -- I...
I’ve used the fscanf() function in the past with no problems, but for some reason, my current use of it in my C-mex s-function (Matlab-compatible C code) is causing problems. Below is a simplified...
Thanks for your input, everyone. I should have mentioned earlier that the rotaxis[][] array actually has the dimensions 5x3 (different than the other 4x4 arrays that I cited), so the for loop's j...
I have some Matlab m-code that involves matrix operations, which I had to convert to C code. I’ve reviewed my code’s logic numerous times, and can’t yet find the logical flaw that’s preventing my C...
Thanks for your input. It looks like I'm going to have to simplify my own code and see where it's going wrong.
hmm, ok, I'll elaborate on my code, below. Thanks. (note: my code is a lot more extensive than what I've shown below, so it's not possible to include it all; but I have re-checked that I have...
myArray[i][j] = 0.0; //!! NOT [4][4]
My apologies, that was a typo... my real code does use the [i][j] array subscripts. Apart from that, do you see any problems?
Hi! I have a 2D array that I need to pass to a function, have its value modified within that function, and then use the altered array within the original function.
Here is a simplification of my...