Respondida
Multiply each element of a vector with a matrix
Yet another method for completeness using an outer product formulation. May not be any faster than bsxfun et al: result = r...

más de 14 años hace | 4

Respondida
fortran 128 bit precision
Are you trying to create a mex routine from your Fortran code (e.g. using Intel ifort) that does the 128-bit floating point calc...

más de 14 años hace | 0

Respondida
Bug in max function?
Documented behavior. When combing double with lesser classes (single, uint8, int32, etc) the conversion is done to the lesser cl...

más de 14 años hace | 1

| aceptada

Respondida
Matlab shuts down after executing a mex call
plhs[] is an array that MATLAB creates when you call the mex function to hold the return variables. But MATLAB doesn't create th...

más de 14 años hace | 2

| aceptada

Respondida
Running the same matlab program in two matlab windows
I do this all the time and it works just fine. However, pay attention to Jason's warnings. I don't write out to any files and I ...

más de 14 años hace | 3

Respondida
MATLAB appcrash when I use mxFree in S-Function
I know nothing about S-functions, but to hazard a guess maybe you need to NULL out the array value after you manually free the m...

más de 14 años hace | 0

Respondida
Why your question is NOT "urgent" or an "emergency"!
Is there a way for TMW to make this post PERMANENTLY appear as the very first post? Or for TMW to scan all new posts for the wor...

más de 14 años hace | 9

Respondida
Passing C function pointers when working with Mex files?
You can put all of your variables that you want to retain values at the top level of your code (i.e., global ... outside of any ...

más de 14 años hace | 1

| aceptada

Respondida
Trouble Calling lapack functions from mex files on 64 bit Windows
Why are you using an mxINT32_CLASS for creating mxPivot? Seems like this would only work if mwSignedIndex is a 32-bit integer on...

más de 14 años hace | 0

| aceptada

Respondida
-largeArrayDims option in Visual Studio
I think you would have to look into the header files (mex.h, matrix.h, etc) to see what macro(s) are actually expected to be def...

más de 14 años hace | 0

Respondida
writing a hex number in the right format
UnitType is a string so use a string format %s instead of the hex format %x. Does your result always have to have exactly two he...

más de 14 años hace | 0

| aceptada

Respondida
Pointer in a C mex sfunction
You don't show the definitions of Int_T, real_T, and InputRealPtrsType, so I am guessing a bit here. y is a pointer to a real...

más de 14 años hace | 0

| aceptada

Respondida
What do you think of Cody, new service for MATLAB Central
My first experience with CODY: Tried the "sum integers from 1 to 2^n" problem. Example used only a scalar input, but I coded ...

más de 14 años hace | 2

Resuelto


Reverse the vector
Reverse the vector elements. Example: Input x = [1,2,3,4,5,6,7,8,9] Output y = [9,8,7,6,5,4,3,2,1]

más de 14 años hace

Resuelto


Sum all integers from 1 to 2^n
Given the number x, y must be the summation of all integers from 1 to 2^x. For instance if x=2 then y must be 1+2+3+4=10.

más de 14 años hace

Respondida
direct access to the result of a function call
This question in various forms has been asked multiple times on this forum and on the newsgroup. The answer is no, you cannot do...

más de 14 años hace | 1

| aceptada

Respondida
What is the most memory efficient way to return large arrays in a C structure from a Matlab C mex function?
You cannot mix native C/C++ memory (i.e., local stack variables or allocated variables with malloc & cousins) into an mxArray fo...

más de 14 años hace | 2

| aceptada

Respondida
Creating a new variable in each iteration...
E.g., with the usual caveats about this typically being a bad idea: eval(['x_' num2str(count) ' = i^2']);

más de 14 años hace | 2

| aceptada

Respondida
How to handle large matrices
Here is some m-code for what I *think* you want: m1 = size(pc_raw,1); m2 = size(fw_raw,1); k2 = 1; for k1=1:m1 ...

más de 14 años hace | 1

Respondida
Doing multiplication and division within a sum()?
Change the offending array class to double.

más de 14 años hace | 1

| aceptada

Respondida
argmin of a vector
From the documentation for the min function: [C,I] = min(...) finds the indices of the minimum values of A, and returns them ...

más de 14 años hace | 2

| aceptada

Respondida
Find a length of string/array without length function
I have no idea what the point of this question is, but do you mean something like this? try k = 1; while( tru...

más de 14 años hace | 1

| aceptada

Respondida
empty sparse matrix with size greater than (100000,100000) needs overhead space
Sparse matrices in MATLAB always store an index vector that is the same size as the number of columns+1. So even for an empty sp...

más de 14 años hace | 1

| aceptada

Respondida
[Linux 64 bit] MEX seg fault on simple FORTRAN file
The timestwo.f example only works for scalar inputs. How are you calling it? (Side Note: size is a Fortran intrinsic function na...

más de 14 años hace | 0

Respondida
Please Speed UP This Algoritm!!!
Another option you can try using some FEX submissions (slightly better at memory management than your original code): unini...

más de 14 años hace | 0

Respondida
merge date time
If X is your original M x 2 data: X(:,1)*1000000 + X(:,2)

más de 14 años hace | 0

Respondida
sum in matrix
y = cumsum(x);

más de 14 años hace | 2

| aceptada

Respondida
how to load data to workspace through m-file
See this FEX submission by John D'Errico: <http://www.mathworks.com/matlabcentral/fileexchange/27106-putvar-uigetvar>

más de 14 años hace | 0

| aceptada

Respondida
IEEE Arithematic
Limitations of floating point arithmetic, again. Particularly with matrix and vector operations, you are not guaranteed any part...

más de 14 años hace | 0

| aceptada

Respondida
Computer Arithematic
The limitations of floating point arithmetic. IEEE double precision can't store your numbers exactly, so the closest number in t...

más de 14 años hace | 0

| aceptada

Cargar más