Respondida
How can I implement in Matlab next function
Is this what you need? http://www.mathworks.com/help/matlab/ref/randn.html?searchHighlight=randn

más de 10 años hace | 0

Respondida
Invalid MEX-file: The specified procedure could not be found.
mex routines, in general, are MATLAB version specific. You *might* be lucky and be able to get a mex routine compiled in one ve...

más de 10 años hace | 0

Respondida
How to use a loop for an array
Does something like this do what you want? n = ceil(max(values)); x = bsxfun(@ge,values(:),0:n-1) & bsxfun(@le,values(:)...

más de 10 años hace | 0

Respondida
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...

más de 10 años hace | 0

Respondida
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 =...

más de 10 años hace | 0

| aceptada

Respondida
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 ...

más de 10 años hace | 1

| aceptada

Respondida
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

más de 10 años hace | 0

Respondida
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...

más de 10 años hace | 0

| aceptada

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

más de 10 años hace | 0

| aceptada

Respondida
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...

más de 10 años hace | 0

| aceptada

Respondida
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...

más de 10 años hace | 0

Respondida
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...

más de 10 años hace | 0

| aceptada

Respondida
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...

más de 10 años hace | 0

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

más de 10 años hace | 0

| aceptada

Respondida
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...

más de 10 años hace | 0

Respondida
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...

más de 10 años hace | 1

Respondida
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...

más de 10 años hace | 0

| aceptada

Respondida
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...

más de 10 años hace | 0

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

más de 10 años hace | 1

| aceptada

Respondida
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 ...

más de 10 años hace | 0

Respondida
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...

más de 10 años hace | 0

Respondida
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://...

más de 10 años hace | 0

Respondida
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://...

más de 10 años hace | 1

Respondida
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...

más de 10 años hace | 0

Respondida
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 ...

más de 10 años hace | 0

| aceptada

Respondida
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...

más de 10 años hace | 1

Respondida
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 ...

más de 10 años hace | 0

| aceptada

Respondida
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. ...

más de 10 años hace | 0

Respondida
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...

más de 10 años hace | 1

| aceptada

Respondida
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...

más de 10 años hace | 0

Cargar más