Answered
Using mex for c++ file
LCC is a C compiler, not a C++ compiler. You need to select option 3 above (MIcrosoft Visual C/C++) to compile cpp files.

13 years ago | 0

Answered
About the calculation precise
For your particular example, none of the values can be represented in IEEE double exactly: >> num2strexact(60.425) ans...

13 years ago | 0

Answered
while loop keeps running indefinitely
You never set test to anything other than 0, so the loop condition is always true.

13 years ago | 0

| accepted

Answered
Zero inputs in C-Mex-function
// 0 inputs, any reasonable number of outputs (scalars 1, 2, ... etc) #include "mex.h" void mexFunction(int nlhs, mxArra...

13 years ago | 0

| accepted

Answered
How can I create variables with for loop?
<http://www.mathworks.com/matlabcentral/answers/143-how-do-i-make-a-series-of-variables-a1-a2-a3-a10>

13 years ago | 2

Answered
Is comparing type mwSize to an int valid?
If int_T is a 32-bit integer and mwSize is a 64-bit integer (typically size_t, unsigned) then yes it is physically possible to h...

13 years ago | 0

| accepted

Answered
Using mex files with Fortran 90
Not sure what the options files look like on a Mac, but if you see a /fixed option on the COMPFLAGS line, get rid of it. That is...

13 years ago | 0

Answered
vectorizing calculation of eigen values of a large multi-dimensional array
How large is large? You could form the tensor as a 3x3xN matrix and then use this FEX submission by Bruno Luong: <http://www....

13 years ago | 0

| accepted

Answered
index in mxSetProperty or mxGetProperty
It crashes because there is only one element in the testcalls array being passed into the mex routine. I.e., I expect you are do...

13 years ago | 1

Answered
Segmentation violation error when I run a mex file
You should use "implicit none" in your code ... it is one of the few friends you have in Fortran. You should declare all of y...

13 years ago | 1

| accepted

Answered
How to index all columns but one in a matrix?
B = A; B(:,3) = [];

13 years ago | 6

| accepted

Answered
How does it work pcode?
You might start with these threads: <http://www.mathworks.com/matlabcentral/answers/75012-pcode-obfuscation-cracked-alternati...

13 years ago | 3

Answered
Evaluate a cubic equation
Type this into Google (copy & paste from your description): "MATLAB function that evaluate a cubic equation" Click on the ...

13 years ago | 0

Answered
1.1 - int32(1) = 0 ?
E.g., see here: <http://www.mathworks.com/help/matlab/matlab_prog/integers.html> "Arithmetic operations that involve both ...

13 years ago | 1

| accepted

Answered
Resultant matrix is rotated 90 whether I use MEX or MatLab function
It is the code that you don't show that is likely at the heart of the problem ... the indexing you use and how it relates to the...

13 years ago | 2

Answered
First non-zeros of a sparse array
You can use a mex routine for this, but you will need a C compiler to compile it. E.g., create a file called firstNonZeroMex.c w...

13 years ago | 1

Answered
Accessing elements in an mxArray
mxGetCell(num, 40) returns an (mxArray *), i.e. a pointer to an mxArray. Thus, by extension, *mxGetCell(num, 40) deferences that...

13 years ago | 1

| accepted

Answered
Fastest way to fill in an array
The results will be highly dependent on MATLAB version used. Since none of the examples explicitly pre-allocate the result, you ...

13 years ago | 5

Answered
Creating a structure within a structure in C++
Some comments about the m-file code: a.b.field1="data"; Creates a structure 'a' with one field, 'b'. Also 'b' gets crea...

13 years ago | 1

Answered
Using xlsread with the MATLAB Engine
Please explain "returning 0". Is the engEvalString call itself returning 0? If so, that is good because that is the normal state...

13 years ago | 0

| accepted

Answered
minimum row value and return the row
If you want row that contains the minimum value (it is not clear to me what "minimum row" means): [x xi] = min(A(:)); xi...

13 years ago | 0

Answered
Updating variables in workspace from MEX functions
What you are doing wrong is mixing C/C++ native memory with MATLAB memory. If you do this MATLAB will crash, as you have found o...

13 years ago | 0

| accepted

Answered
How to force MATLAB to use single precision ONLY?
Good Luck. I have struggled for years with this difficulty when trying to emulate algorithms that run on a different computer...

13 years ago | 3

Answered
mexw64 function dynamically linked to .dll will not run w/out c compiler
Typically you don't need the C compiler itself installed, you only need the libraries, which are usually free to download and in...

13 years ago | 0

| accepted

Answered
xlsread and MATLAB engine Question
You can use xlsread in a MATLAB Engine and then send it to your C++ program. Note that *all* data sent between the Engine and yo...

13 years ago | 1

| accepted

Answered
How to import a file with multiple formats (8 bit words, 16 bit words, 32 bit data)
Try something like this to start with: fid = fopen('altestbif (10).BIF6'); if( fid == -1 ) % handle error e...

13 years ago | 1

| accepted

Answered
Problem comparing two variables
Floating point operation limitations. E.g., see here <http://www.mathworks.com/matlabcentral/answers/41536-why-is-2-24-10-22-...

13 years ago | 0

| accepted

Answered
Applying LeapYear function into the Matlab Scipt
Put your isLeapYear function code (everything from the function LeapYear etc line to the corresponding end line) in a separate f...

13 years ago | 2

| accepted

Answered
Mutiply 4d array of size (360,210,63,48) by vector of length 48?
I think this will do it if you want Final2 to be the same shape as Final (not at a machine with MATLAB right now): z = size...

13 years ago | 1

| accepted

Load more