Answered
Is Walter Roberson a real person, or is he some kind of Matlab AI robot?
Blade Runner 2019 ...

7 years ago | 1

Answered
single precision simulation of internal calculations
" Is there a way to set Matlab to perform all calculations (even internal) to single precision? " Not the way you are probably ...

7 years ago | 0

| accepted

Answered
How do i convert this for loop into a while loop?
This for loop: for i=1:n % stuff end is equivalent to this while loop: i = 1; while i <= n % stuff i = i + 1...

7 years ago | 1

| accepted

Answered
How can I vertically concatenate cells?
I don't have much of a clue what you really need, but maybe this will give you a start on the MATLAB cell array syntax (with the...

7 years ago | 0

Answered
Functions, Error check
From your description, it seems like you simply need to test for the number of characters. E.g., while numel(outstring) == 0

7 years ago | 0

| accepted

Answered
How to implement such function?
Basically, just replace f(x) with f. E.g., f = constant; : f = coeffVector(i) * cos(i*x) + f; You could also do this wit...

7 years ago | 0

Answered
How to from I(x) to permutation and from permutation to I(x)
E.g., >> Per Per = 0 1 2 3 0 2 3 1 0 3 1 2 3 2 0 1 ...

7 years ago | 0

Answered
case of two mappings
Not sure which one is first, but maybe one of these is what you want? >> mapping1 = [0 1 3 2] mapping1 = 0 1 3 ...

7 years ago | 0

Answered
what wrong about this error
The error message appears when you have a mismatch in the number of elements on the rhs and the number of elements on the lhs. E...

7 years ago | 0

Answered
Why is subtracting different sized matrices not giving me an error? What is matlab calculating?
See documentation on "implicit expansion" https://www.mathworks.com/help/matlab/matlab_prog/compatible-array-sizes-for-basic-op...

7 years ago | 0

| accepted

Answered
store values from loop in an array
Typos in your code: for i=1:length(A) And change tableA to TableA (MATLAB is case sensitive). Or, you could get rid of the l...

7 years ago | 0

| accepted

Answered
Combination of X and Y vectors to get all possible positions on a Cartesian plane
[XX,YY] = ndgrid(X,Y); Z = [XX(:),YY(:)];

7 years ago | 0

| accepted

Submitted


C Mex MATLAB Version
Mex C code to determine MATLAB version at compile time and run time

7 years ago | 727 downloads |

0.0 / 5

Answered
mxCreateNumericArray error: cannot convert 'int*' to 'const size_t* {aka const long long unsigned int*}' for argument '2' to 'mxArray*
Simply replace this int* dims = new int[par->ndim]; with this mwSize* dims = new mwSize[par->ndim];

7 years ago | 1

| accepted

Answered
How do I implement bsxfun column-wise?
C = arrayfun(@(i)func(A(:,i),B(i)),1:size(A,2)) This just hides the loops behind arrayfun ... it doesn't eliminate them.

7 years ago | 1

Answered
how to replace a column in a matrix
Instead of replacing all of the columns of A, use a different variable for the result. E.g., a cell array named C. So instead o...

7 years ago | 0

| accepted

Answered
Function Return only one value
Call it with two requested outputs: [X,Y] = MyEKFFun(31,24,18,330,364,379,1,1.1,1.3,2) Since you were calling it with no reque...

7 years ago | 4

Answered
any easier way to find cell by string
Assuming the strings all start with 'test', e.g. find(cellfun(@(C)C(end)=='a',A))

7 years ago | 0

| accepted

Answered
cant workout why vectors aren't the same length
If you pass zeros( ) only one argument, it creates a square 2D matrix, not a vector. So give it two arguments to make your resul...

7 years ago | 0

Answered
Question about array alternating between positive and negative
Seems like there should be a shorter way, but assuming you are looking for all 0 crossings and not just the positive to negative...

7 years ago | 0

| accepted

Answered
Can you compile a code including linprog function?
If you look here, linprog is not one of the Coder supported functions: https://www.mathworks.com/help/coder/ug/functions-suppor...

7 years ago | 0

| accepted

Answered
Writing a MATLAB script for equations
E.g., put these lines in a file with a .m extension: lambda = input('Input a value for lambda: '); mtbf = 1 ./ lambda; Are yo...

7 years ago | 1

| accepted

Answered
Lapacke in level-2 C S-function
According to the interface listed here and the link you list above: http://www.netlib.no/netlib/lapack/double/dpotrs.f The n, ...

7 years ago | 0

| accepted

Answered
Index Exceeds Array Bounds
Normally I would have expected to see code that sets the next values of x and y, but I don't see it. I.e., I am looking for line...

7 years ago | 0

| accepted

Answered
Finding remaining numbers in logical indexing?
E.g., find1 = length<1; : find2 = (length < 3) & (max_width_head > mean_width_neck*2); : find3 = max_width_head>=me...

7 years ago | 0

| accepted

Answered
How to use mxCreateNumericArray
This line is incorrect (wrong function and signature): plhs[0] = mxCreateNumericArray(xynum,1,mxINT16_CLASS); /*Creates a ma...

7 years ago | 1

| accepted

Answered
Why is my if statement breaking when condition is not met?
The == operator is an element-wise operator. You need to use a string comparison function for this. E.g., if( strcmpi(verbose...

7 years ago | 0

| accepted

Answered
Multidimensional arrays do not work in mex functions?
You can't use multi-level [ ][ ]... syntax with simple pointers. E.g., look at these lines: void matsum(double *dphidt, double ...

7 years ago | 0

Answered
An efficient (quick) way of entering complex data into Matlab workspace.
Assuming you are using R2018a or later, you might try this FEX submission which can reinterpret real variables as interleaved co...

7 years ago | 0

| accepted

Answered
How to get direction for 3d angles between 2 vectors
You will need to define in your code which direction is the clockwise and which is counterclockwise. You can do that by definin...

7 years ago | 1

| accepted

Load more