Answered
Is there an easy way to replace NaNs with empty cells when converting a numeric array to a cell array.
e.g., A = your double array; C = your cell array; idx = isnan(A); C(idx) = {[]};

15 years ago | 1

| accepted

Answered
3D matrix multiplication
M = mtimesx(A,B); You can find MTIMESX here: <http://www.mathworks.com/matlabcentral/fileexchange/25977-mtimesx-fast-m...

15 years ago | 3

| accepted

Answered
Moving Complex Data to a .mat file from a C Program
The answer will depend on how the data is currently stored in your C variable. If the C data is stored as a single variable in...

15 years ago | 0

| accepted

Answered
Using mexCallMATLAB to instantiate an object ?
You can't use any of the mex___ API functions with the MATLAB Engine, you have to use the eng___ API functions. Since there is n...

15 years ago | 0

| accepted

Answered
Find smallest FIVE elements in a vector
See the 2nd output of the sort function giving the original indexes of the sorted values. [B,IX] = sort(A,...)

15 years ago | 1

| accepted

Answered
Why are the results of the size function different from the whos function Size?
Doing this: size excelstring Is equivalent to doing this: size('excelstring') Whenever you invoke a function wit...

15 years ago | 5

| accepted

Answered
Mex Fortran Gateway Function
OK, here is some code you can try (CAUTION: UNTESTED). Uses the Fortran 95 MATLAB interface code from the FEX I mentioned in an ...

15 years ago | 2

| accepted

Answered
Mex Fortran Gateway Function
Please provide the exact interface for this routine: subroutine crvfit(xfit,yfit,xfite,yfite,imode,yfit2,nptsf,delfac) ...

15 years ago | 0

Answered
MEX File, UBUNTU, .so files
If I understand you correctly, you have C++ source file(s) and some other object files and you want to build a mex routine from ...

15 years ago | 0

| accepted

Answered
Use of 3D array. Find inverse of individual page
See this small size linear solver by Bruno Luong: <http://www.mathworks.com/matlabcentral/fileexchange/27762-small-size-linea...

15 years ago | 0

Answered
MATLAB API automation
Just don't close the engine. i.e., don't call engClose at the end of your program. Once the program ends, your MATLAB Engine ses...

15 years ago | 0

Answered
Specify runtime path with mex
The parser doesn't always give you what you expect when you include all of your inputs on the command line like you have shown. ...

15 years ago | 1

Answered
C++ comments in Mex files under Linux
Probably it's the same reason they still include the silly "/fixed" option on the Fortran mexopts.bat files (which forces free-f...

15 years ago | 2

| accepted

Answered
How to find vector elements between two values, efficiently
You can try a mex approach. The following file does the exact calculation shown above. If you need to modify it for different co...

15 years ago | 1

Answered
binary generator
See the rand function. There are various ways to get 0 1 results depending on what you are doing with it downstream. Do you want...

15 years ago | 2

| accepted

Answered
Problem passing large array between matlab and mex function
The first thing I would do would be to examine all of the function/subroutine interfaces that you use and make sure they are cor...

15 years ago | 0

Answered
minimization problem -using simplex method
Which Simplex Method? Dantzig or Nelder-Mead?

15 years ago | 0

| accepted

Answered
Extracting parts of a matrix implicitly (without storing the matrix)
You can do what you show directly in Fortran, and kinda do it in C, but MATLAB has no official way of pointing to parts of other...

15 years ago | 0

Answered
Handling Pointers in C++ library
MATLAB stores character data as 2-bytes per character. You can get a pointer to the character data with mxGetData, and pass that...

15 years ago | 0

Answered
cell array or multidimensional array?
Depends on what you are doing with the data downstream. If you are accessing array slices of A a lot, then the cell array approa...

15 years ago | 4

| accepted

Answered
Why do you come to "MATLAB Answers"?
j. To see how much farther back my reputation points are compared to Walter and Matt.

15 years ago | 1

Answered
Wrong values with greater than, equal and less than or equal functions
You might find this utility useful: <http://www.mathworks.com/matlabcentral/fileexchange/22239-num2strexact-exact-version-of-...

15 years ago | 2

Answered
When to break the MATLAB rules?
In-place operations in mex routines when the variables are huge and you can't afford the extra copies that MATLAB would normally...

15 years ago | 3

Answered
when I make sparse matrix in C-MEX , eigs fuctions call doesn't work
See this FEX submission by Tim Davis to help you diagnose sparse matrix formation problems in a mex routine: <http://www.math...

15 years ago | 0

Answered
converting to/from C++ arrays to mxArrays
pdata *is* a regular C++ pointer and can be used as a regular C++ array in most contexts. Try checking the API results to see th...

15 years ago | 0

Submitted


UNINIT - Create an uninitialized variable (like ZEROS but faster)
UNINIT is similar to ZEROS, except UNINIT returns uninitialized values instead of zero values.

15 years ago | 3 downloads |

5.0 / 5
Thumbnail

Answered
Double precision
I didn't know double precision was broken. You can get higher precision with the Symbolic Toolbox. Or if you only need integers,...

15 years ago | 1

| accepted

Answered
pseudo-random number generator rand() in .mex
When you first run a mex function it loads into memory and stays in memory until it gets cleared. So any variables that are glob...

15 years ago | 0

| accepted

Answered
How does Squeeze work?
The squeeze function is similar to reshape in that it changes the dimensions of a variable without moving any of the data in mem...

15 years ago | 3

Answered
Can you have both 32 bit and 64 bit MATLAB installed?
Yes, I believe so based on comments posted on the newsgroup by others. I don't currently have this setup myself.

15 years ago | 0

Load more