Answered
Can someone explain this error to me?
What are the dimensions of a1 and a2, and any other variable you have in that line? If the first dimensions are not 1, they will...

11 years ago | 0

Answered
Why can't I access day, juliandate?
If it is just this function you need, then you could use this instead: datenum(whatever) + 1721058.5 For day you could u...

11 years ago | 1

Answered
Error Message while executing these function - Unbalanced or unexpected parenthesis or bracket
Don't use subscripts in function argument lists. I.e., don't use the (1) and (2) below: function [AA1,AA2] = distributingth...

11 years ago | 0

Answered
Can somebody tell me why, when I call a function using an input, the input is disregarded?
You show code for function sensingmatrix3d, but your example is calling test3dmatrix. How are the two related? Look at how test3...

11 years ago | 0

| accepted

Answered
MEX Compiler Error....for WINDOWS 10?
See this thread: http://www.mathworks.com/matlabcentral/answers/223444-will-matlab-be-compatible-with-windows-10

11 years ago | 0

Answered
parallel for loop in mex
Some Microsoft compilers support OpenMP, but I don't think the vanilla SDK compiler is one of them. Did you mean using OpenMP, o...

11 years ago | 0

Answered
How to set an upper and lower limit on a data set from a matrix
Assuming you want to extract all the rows where the 3rd column meets your conditions: GalList = your matrix lower_limit ...

11 years ago | 1

Answered
Index exceeds matrix dimensions. Please help.
Do you inadvertantly have a variable called "input" in your workspace?

11 years ago | 0

Answered
I need help with the encryption of a 140 character message
E.g., s = 'a string'; % original string d = double(s); % string turned into numbers t = char(d); % numbers turned bac...

11 years ago | 0

Answered
matlab c shared library: capturing matlab function output with mxArray*/mxArray**
It seg faults because you de-reference an uninitialized pointer with this line: *c = mxCreateDoubleMatrix(1, 1, mxREAL); ...

11 years ago | 0

Answered
Selecting an entry of a row in a large matrix
b = a(3:3:end,1); % 1st element of every 3rd row a(3:3:end,:) = []; % remove every 3rd row

11 years ago | 0

Answered
Issue with Mex Function
You can't re-use mxArray variables like you are doing when you are building a cell or struct array in a mex routine. There is an...

11 years ago | 1

| accepted

Answered
Mex a cpp file in MATLAB, but cannot find .h files, ubuntu 14.04
You need to find those header files. When you do, simply put them in the current directory where the cpp file is.

11 years ago | 0

Answered
Matlab MEX file - index correct, incorrect UINT32 values
The input is a uint8 array, but you are using a uint32_t pointer to access the data. So there is a mismatch. Change this: u...

11 years ago | 1

Answered
C mex file - sort and store index
You compIndex routine does not appear to index into the non-contiguous row data properly. You create an index array idx that ha...

11 years ago | 1

Answered
Using mexw32 model in newer Matlab version
mex functions are not guaranteed to be compatible between MATLAB versions. You might get lucky or you might not. In your case, i...

11 years ago | 1

Answered
How do you integrate a set of matrix equations?
Reshape them as vectors to pass into ode45. Then in your derivative routine, reshape back to matrix form to do your matrix calcu...

11 years ago | 0

| accepted

Answered
How to write a for loop to make the column calculations?
Maybe just add another loop over the columns. E.g., for c=1:4 for i=1:3 y=[Y1{i,c}'] x=[X{i,c}...

11 years ago | 0

| accepted

Answered
zero padding column of data
n = number of elements to pad with 0's x = your 200 x 1 double array x(end+1:end+n) = 0;

11 years ago | 0

Answered
Reshape each row of matrix into separate matrices
You could use a cell array. E.g., mat{I} = reshape(data(I,:),16,16)

11 years ago | 1

| accepted

Answered
Returning mxArray* as void* from a C shared library
Can you create your own custom header file for this library when you load it with loadlibrary, with the (void *) for the functio...

11 years ago | 0

Answered
Will converting the difference between 2 datenums to seconds contain leap seconds or not?
See these related posts: http://www.mathworks.com/matlabcentral/answers/184267-datetime-utcleapseconds-2-second-difference-ac...

11 years ago | 0

Answered
Concatenating element- what the different?
E.g., [1,3,10] is a three element vector with the elements 1, 3, and 10. [1:3:10] uses the colon operator and is a four el...

11 years ago | 0

| accepted

Answered
Delete row not following pattern
Assuming the pattern in the next-to-last column must be 1-2-1-2-...etc exactly [m,n] = size(a); n1 = n - 1; expected ...

11 years ago | 0

| accepted

Answered
Shifting Elements of a Vector to the right while deleting the last number
A = [1 2 3 4 5 0 0 0] % Original vector p = 3 % index for first element to shift z = 1 % number of spots to shift n =...

11 years ago | 0

| accepted

Answered
Question about using ODE45 to solve a system of linear first order DE's using "initial" conditions specified at a later time
Call ode45 twice. Run it once to integrate backwards in time to the "initial" time you want. Then run it again to integrate forw...

11 years ago | 0

Answered
How to convert a vector into a matrix using reshape ,but what should be the size that should be specified?
If it has fewer elements than originally, you can't directly reshape it into the same size original matrix. You could pad with 0...

11 years ago | 0

Answered
Character Array initialization and creation
The straightforward answer is simply to assign a string to a variable name. E.g., mystring = 'This is a string'; % Initiali...

11 years ago | 0

Answered
Execution of for loop and indexing of strucutres
Is p the loop index? A(p:1) could be empty or could be a scalar depending on what p is. B(:,1) is the first column of B. In...

11 years ago | 0

Answered
change in loop calculation and manual calculation
I think you will find that angle has more significant digits than you are printing. E.g., do this format long g angle ...

11 years ago | 0

| accepted

Load more