Answered
Funtion to get 9th term in an array
A(1:9:end)

15 years ago | 0

| accepted

Answered
random number within a rwo vector
A(ceil(rand*numel(A)))

15 years ago | 0

| accepted

Answered
Calling matlab functions from a C code
See the External Interfaces section of the doc, and in particular the mexCallMATLAB function.

15 years ago | 0

Answered
recover basic rotations
You should take a look at SpinCalc in the FEX by John Fuller: <http://www.mathworks.com/matlabcentral/fileexchange/20696-func...

15 years ago | 1

Answered
Compiling with Mex - Can I reference Environment Variables?
Have you tried the function version of the mex command? E.g., mex('-v','COMPFLAGS="$COMPFLAGS -I%REF_DIR%/include"','my_sfu...

15 years ago | 0

Answered
How to create variable in MAT file that is too large to fit in memory?
You could create the MAT file from scratch in a Fortran or C/C++ program using the published uncompressed MAT file format. E.g.,...

15 years ago | 1

Answered
Fast calculation of short cumulative product vector
Here is the quick and dirty mex solution: // File cumprodx.c // c = cumprodx(a,n) does equivalent of c = cumprod(a.*ones...

15 years ago | 0

Answered
Fast calculation of short cumulative product vector
Or this variation, which I don't see in the current posts: y = cumprod(a.*ones(1,n)); I think the MATLAB JIT may recogn...

15 years ago | 2

Answered
row/column indexing in MEX file
I don't think you are going to be able to write code that is significantly faster than A[i+j*n_rows]. You could allocate an arra...

15 years ago | 0

Answered
find peaks
You might try one of the FEX submissions, e.g. PeakFinder by Nate Yoder: <http://www.mathworks.com/matlabcentral/fileexchange...

15 years ago | 1

Answered
using matlab engine from c++: How to convert a int** into mxArray*
Repeating your comment above for how you allocate opSet: opSet = new double*[columns]; for (p=0; p<columns ; p++) o...

15 years ago | 2

| accepted

Answered
What is your time zone?
Here is a related thread to see what your Java package thinks about your timezone: <http://www.mathworks.com/matlabcentral/an...

15 years ago | 2

Answered
mxMalloc vs mxCreate
You will need to provide more details on your questions. For your 2nd paragraph, note that you CANNOT mix C native memory into a...

15 years ago | 0

Answered
Accessing handle graphics from within Fortran mexfunction
You can get Fortran versions of mexGet and mexSet in my Fortran 95 interface package, which can be found here: <http://www.ma...

15 years ago | 0

Answered
Mex problems on 64bit machine
You need to strictly follow the API types. You don't get automatic argument type conversion in Fortran like you do in C. Change ...

15 years ago | 1

Answered
Floating Point Representation
1) What does this have to do with MATLAB? 2) How can you have numbers in the e-9 and e-12 range with only one exponent digit?...

15 years ago | 0

Answered
Converting Vector to matrix.
Also not sure how general you want the method to be, but here is another way for your particular example: n = ceil(numel(V)...

15 years ago | 0

Answered
Access preallocated matrix on left hand side inside MEX
To do what you are asking to do, you would pass in x as an input argument and then modify it in place (i.e., it would be one of ...

15 years ago | 0

Answered
Need 32 bit version of Matlab for Windows XP
If you have several versions available (e.g., maybe you are on a service schedule) I would install *all* of them.

15 years ago | 0

Answered
How to solve big sets of linear equations in c++ using MATLAB functions
In a mex routine you can iteratively call MATLAB functions via mexCallMATLAB to do the solving etc. You can pass variables back ...

15 years ago | 0

Answered
Advice on reading an unformatted Fortran binary file into Matlab
Fortran unformatted binary, unfortunately, is not like C binary or MATLAB binary. Fortran binary typcially puts in record marker...

15 years ago | 0

| accepted

Answered
Using Clohessy-Wi;tshire equations to demonstrate the projected circular orbit trajectory base on the initial conditions defined by parameters of Chief Satellite and Deputy Satellite Initial condition
1) Google "Clohessy Wiltshire" 2) Look at the first link 3) Look at the closed form solution on the first page of this lin...

15 years ago | 0

| accepted

Answered
Sparse C MEX File
This is causing the seg fault: mxSetIr(weights_pointer,mxGetIr(array_q)); mxSetJc(weights_pointer,mxGetJc(...

15 years ago | 0

Answered
Byte ordering in calls from C/C++ to a Matlab-compiled DLL
I don't think you understood what Walter was getting at. These lines will *not* work if myBuffer is supposed to contain float da...

15 years ago | 2

| accepted

Answered
when inserting mexPrintf commands I get different outputs
I haven't examined your code, but I would look for missing prototypes for the functions you use. E.g., it could be that a functi...

15 years ago | 0

Answered
How can this be true? (<) operator not working
0.1 cannot be represented exactly in IEEE double precision floating point format. Welcome to the world of floating point arithme...

15 years ago | 2

| accepted

Answered
time increment and julian date
Caution: To be precise, a sun position algorithm will need a Julian Date based on Ephemeris Time. So you would need to convert t...

15 years ago | 0

Answered
Transpose matrix and then predetermine rows
A = your original column vector; B = reshape(A,24,365).'

15 years ago | 0

Answered
Data from MEX-File to MATLAB
Regarding your crash question, consider this line: plhs[0] = mxCreateNumericArray((input/2)+1,mxGetDimensions(prhs[0]...

15 years ago | 0

| accepted

Answered
How to create a MEX file from a C++ function
Please post the interface to the C++ function you wish to include in the mex function. i.e., specify what the inputs and outputs...

15 years ago | 0

Load more