Answered
How to load a variable from a loop name mat ?
Are you simply asking how to load a specific variable? E.g., variable_to_load = 'X'; for n=1:4 load(['nano',num2...

11 years ago | 0

| accepted

Answered
How to Combine Several Variables Into One Matrix?
The easiest way would be to read your variables into elements of a column vector cell array instead of reading them in as indivi...

11 years ago | 0

Answered
How can I fix the error when multiple two matrices?
Did you mean element-wise multiplication? If so, use the .* operator. E.g., a = your 100 x 1 vector b = your 100 x 1 vec...

11 years ago | 0

| accepted

Answered
?? Error using ==> times Matrix dimensions must agree.
Type the following at the command line: dbstop if error Then run your code. It will pause at the line with the error. Ex...

11 years ago | 0

| accepted

Answered
How to properly write an if-else-statement such that if the condition is met, then the values in x-vector will be stored in the vector; or else the values in the x-vector will not be deleted??
g = (x >= 1) & (x <= 2440); % Logical result of the elements you want to keep x(~g) = []; % Delete the others (or you could...

11 years ago | 1

| accepted

Answered
Random number gerator problem
hist(r, 1:limit); You inadvertently used randomness in your hist call, so MATLAB tried a recursive call with no arguments, ...

11 years ago | 0

| accepted

Answered
How can a MEX file give parameters to a C++ program?
In this line you are using an integer output format %i to print a floating point double value: mexPrintf("Value Read = %i\n...

11 years ago | 1

| accepted

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

Load more