Answered
How can I maintain to complex type when copying arrays?
MATLAB variables store the real and imaginary parts in different areas of memory. For a real variable, the imaginary part is not...

14 years ago | 0

| accepted

Answered
Error with mex function
Reading a MATLAB character string with Fortran syntax logical constants into a Fortran logical variable: character*20 TF ...

14 years ago | 0

| accepted

Answered
C++ std::tr1::array
The LCC compiler that ships with MATLAB is a C compiler, not a C++ compiler.

14 years ago | 0

Answered
how to inverse a vector
For reversing the elements even if they are not sorted: v(end:-1:1) or flipud(v) % or use fliplr for a row vector ...

14 years ago | 1

| accepted

Answered
logarithm of base other than e,10 and 2
logB(X) = logA(X) / logA(B) You can pick A to be one of the built in functions, like log or log2 or log10. E.g., l...

14 years ago | 10

| accepted

Answered
Helping -largeArrayDims flag find c files
You need to set the current directory to the directory where diagmult.c is located. Then try the mex command again.

14 years ago | 0

| accepted

Answered
Mex function, one or more output arguments not assigned
102 outputs is a *LOT*, and seems to me would be hard to maintain. Returning a single cell array would probably be a better appr...

14 years ago | 2

Answered
Reading memory that belongs to another process on Windows
No. In general, the memory of one process cannot be accessed by another process. There are ways to pass data such as the address...

14 years ago | 0

Answered
how do you use the built taylor function, can some one give an example
From the documentation: syms x taylor(exp(x)) taylor(sin(x)) taylor(cos(x)) ans = x^5/120 + x^4/24 + x^3...

14 years ago | 1

| accepted

Answered
Creating matrix of maximum values from multiple dimension matrix
Your words don't seem to match your example, at least to me, since you seem to be taking the max of the rows, not the columns. B...

14 years ago | 0

Answered
what is the optimal way to build a sparse matrix from row/col index, and value data?
Is the result of the query sorted? I.e., is it already in column major order the way MATLAB will naturally store it? (1,1) follo...

14 years ago | 0

Answered
saving in loop-- using eval or num2str?
save(filename, ['events_' num2str(yr)]);

14 years ago | 2

Answered
How can I convert a string to a double precision decimal number without losing the leading zeros ?
Is the comma in the string meant to be a decimal point? E.g. s = '-0,01298784' s(s==',') = '.' str2double(s)

14 years ago | 1

| accepted

Answered
Deep copy of handle object?
You could try a mex function, but I have not investigated how the API routine mxDuplicateArray behaves with handle-derived class...

14 years ago | 0

Answered
Euler Angle Calculation from rotated reference frame
You can use this FEX submission by John Fuller to convert from a direction cosine matrix to any Euler Angle sequence you like: ...

14 years ago | 2

Answered
When to use MEX in a MATLAB progam (Example of an Ulam Map)
For starters, get rid of the function call overhead: B[n] = 1.0-2.0*(B[n-1]*B[n-1]); You can also play games with *B vs...

14 years ago | 0

Answered
MEX - Multidimensional Array passing to Fortran
A couple of options: -------------------------------------- 1) See this FEX submission: <http://www.mathworks.com/m...

14 years ago | 0

| accepted

Answered
Performing Gauss Elimination with MatLab
You could start with this FEX submission: <http://www.mathworks.com/matlabcentral/fileexchange/13451-gauss-elimination-with-c...

14 years ago | 0

Answered
Define a Sparse Matrix without sparse function.
The sparse command can use multiple input formats: < http://www.mathworks.com/help/techdoc/ref/sparse.html> E.g., "S =...

14 years ago | 2

| accepted

Answered
Help with Mex function
mwPointer mxGetField mwPointer mxGetPr mwPointer mxcreatedoublematrix mwIndex index mwpointer var_ptr, fd_ptr, sfd...

14 years ago | 0

| accepted

Answered
Finding CRS format of matrix in Mex
Can't you just transpose it within MATLAB, and then treat the resulting row indexes as column indexes and column "pointers" as r...

14 years ago | 0

Answered
Change a 4-D matrix
A = permute(A,[1 2 4 3]);

14 years ago | 1

| accepted

Answered
Creating a cell array of size n
The most memory efficient way is the following without a loop: C(1:n) = {'red'}; % Assuming C doesn't exist yet (EDITED) ...

14 years ago | 2

| accepted

Answered
treating NaN as a unique value (instead of as a distinct)
Assuming the input A is double class and all the NaN values have the same underlying bit pattern (which seems to be true of the ...

14 years ago | 2

Answered
MEX Code in Matlab Wrapper
Yes, it does take extra time to repeatedly do the allocation/deallocation. In your current code, is this a C++ object? A MATLAB ...

14 years ago | 0

Answered
Copying dynamic array to MxArray object using memcpy in c++
Problem #1) Your method is a poor way to allocate a 2D matrix because it does *not* require that all of the individual column...

14 years ago | 1

| accepted

Answered
Problem extracting data out of a variable of mat file in C++
Your incorrect code: /*Get Variable*/ pa = matGetVariable(pmat, file); The 2nd argument is supposed to be the var...

14 years ago | 0

Solved


inner product of two vectors
inner product of two vectors

14 years ago

Answered
As a Software Engineer, Why should I use MATLAB?
It's fun.

14 years ago | 4

Load more