Answered
When I overwrite an m-file in Matlab, the old version stays in memory. how can this be fixed?
After saving your new m-file, clear the old already-parsed m-file from memory. This will force MATLAB to read the new m-file the...

10 years ago | 0

Answered
Algorithm for an elimination matrix
m = size(A,1); % Size of A T = tril(ones(m)); % Lower triangle of 1's f = find(T(:)); % Get linear indexes of 1's k =...

10 years ago | 0

| accepted

Answered
How to determine MEX API version?
I have a complicated macro to detect API version at compile time that I could post, but if you are only trying to deal with the ...

10 years ago | 1

| accepted

Answered
Saving a matrix in a .txt file
Do you mean like this: save myfile.txt A -ascii Or for more precision: save myfile.txt A -ascii -double

10 years ago | 0

Answered
creating a for loop with a mixture of strings and numbers as outputs
Does this do what you want: sprintf('max%d.csv', k) In general, you can use concatenation brackets [ ] to join strings t...

10 years ago | 0

| accepted

Answered
Number of non-zero element
D = sum(cat(3,A,B,C)~=0,3);

10 years ago | 0

| accepted

Answered
Trouble building mex function from .c file
Your prototype declares the first six arguments as double, not pointer_to_double: void AircraftModel_(double, double, doubl...

10 years ago | 0

| accepted

Answered
square root of a big number
You can use the Symbolic Toolbox for this, or use this FEX submission by John D'Errico: http://www.mathworks.com/matlabcentra...

10 years ago | 0

Answered
Something must be a floating point scalar?
The error message seems pretty clear. The x limits must by scalar values. The y limits can be functions of x. Just rearrange thi...

10 years ago | 0

| accepted

Answered
Mex entry point missing (despite correct entry)
Do the mex compile at the command line with the verbose option, then look at how it is being compiled and everything that is get...

10 years ago | 0

Answered
Writing an number array in specific format
aa = 1:10000; aa(4:4:end) = [];

10 years ago | 0

| accepted

Answered
Edit .exe file in Matlab without original Matlab file?
In general, no, you cannot do this in the sense you are probably asking (i.e., somehow recover a semblance of the original sourc...

10 years ago | 0

Answered
Memory leak in mex file
Sounds like you have two problems, a memory leak and MATLAB crashing. Let's clear up the MATLAB crashing first and then get back...

10 years ago | 1

Answered
loop to create 3x3 matrix for each frame
Does this do what you want: R.fcsR = zeros(3,3,247); for i = 1:247 R.fcsR(:,:,i) = [Xn.fcsR(i,:); Yn.fcsR(i,:); Z...

10 years ago | 0

| accepted

Answered
How do I make the matrix match in size
Instead of using x and y in your z equation directly, first make a grid of x and y values. E.g., [X Y] = ndgrid(x,y); Th...

10 years ago | 0

Answered
Euler Angles from rotation matrix
You might start with this FEX submission called SpinCalc by John Fuller: http://www.mathworks.com/matlabcentral/fileexchange/...

10 years ago | 1

| accepted

Answered
Error: MAT file cannot be loaded because it contains duplicate variables
If you have a C compiler installed, you might try this FEX submission which uses a mex routine to load variables one-by-one and ...

10 years ago | 0

Answered
help with asin and acos
You made a decent start so I will offer some suggestions/corrections. You are using n1 for both the input and the output. Don...

10 years ago | 0

Answered
How to fix the external link error while using mex?
You need to have the gateway function mexFunction in your source code. See this link and the examples listed there: http://...

10 years ago | 0

Answered
how to run hello.cpp without the link error?
You need to have the gateway function mexFunction in your source code. See this link and the examples listed there: http://...

10 years ago | 1

Answered
how to run a c++ file in matlab using mex?
You need to have the gateway function mexFunction in your source code: http://www.mathworks.com/help/matlab/apiref/mexfunctio...

10 years ago | 0

Answered
How to transform a matrix to a binary type in Matlab?
E.g., using a loop: [m,n] = size(A); n1 = n - 1; B = zeros((m-1)*n1+1,n); B(1,:) = A(1,:); for k=2:m kx ...

10 years ago | 0

| accepted

Answered
How do I add a known vector to an existing matrix in a loop?
There is a way to do this using the eval function, BUT you are strongly advised against this approach. Rather, you should be us...

10 years ago | 1

Answered
Value Storage from Cells with Matlab
Type the following at the MATLAB prompt: dbstop if error Then run your code. When you get the error the code will pause ...

10 years ago | 0

| accepted

Answered
convert specific vector to vector in one direction
a = av(1:2,1:2); If this simple solution is not what you are looking for then please give more details in your question. ...

10 years ago | 0

Answered
MEX Fortran Gateway and Sparse Matrices
Sparse matrices and full matrices are internally stored differently. For full matrices, all of the matrix values are physically...

10 years ago | 1

| accepted

Answered
Problem with plotting functions regarding a projectile motion
sin(angle) is a column vector, and t is a row vector, so sin(angle)*t will be a 2D matrix. But g*t.^2/2 will have the same dimen...

10 years ago | 0

Answered
Is it possible to keep Matlab objects as mxArray type in C++ application ?
How do you plan on calling the MATLAB functions? With the Engine API interface? If so, then as long as you build the applicatio...

10 years ago | 0

| accepted

Answered
mtimesx crashes when used
It has been a long time since I have had access to MATLAB with a C compiler, so it is hard for me to debug this. However, try th...

10 years ago | 1

| accepted

Answered
Question about monte carlo simulation
Monte Carlo means you will be estimating the probability by making a large number of sample runs (aka trials) and then counting....

10 years ago | 1

| accepted

Load more