Respondida
How can I make the "number of elements" the same?
Here you are building up TH3 elements in a loop, so TH3 will be a vector: TH3(n)=acosd((L2*cosd(TH2))/L3) And here you m...

alrededor de 10 años hace | 0

Respondida
Does anyone have the code for the quat2euler fuction?
I would recommend the SpinCalc FEX submission by John Fuller: http://www.mathworks.com/matlabcentral/fileexchange/20696-funct...

alrededor de 10 años hace | 0

Respondida
Can you return a matrix for all elements of vector A through vector B without a loop?
Assuming the values in A and B are consistent: n = B(1) - A(1); C = bsxfun(@plus,A,0:n);

alrededor de 10 años hace | 1

| aceptada

Respondida
Assign a vector to a cell element
c{3} = v;

alrededor de 10 años hace | 0

| aceptada

Respondida
"Error using zeros" maximum variable size allowed by the program is exceeded
A matrix of size 2^57 x 57 doubles would take about 6.57e19 bytes of memory ... way way more than your computer has available. S...

alrededor de 10 años hace | 2

Respondida
If statement using the value in the row before
You probably started the loop with i=1. When i=1, the i-1 index evaluates to 0, hence the error. Start your loop at i=2 instead...

alrededor de 10 años hace | 0

| aceptada

Respondida
How can I multiply two matrices of difference size
Use the "dot" version of the operators to do element-wise multiplication and division. E.g. v = q .* (sqrt((w))); Pressu...

alrededor de 10 años hace | 1

| aceptada

Respondida
How to draw a line from a point A(x1,y1,z1) to B(x2,y2,z2) ?
plot3([x1 x2],[y1 y2],[z1 z2]) grid on

alrededor de 10 años hace | 0

Respondida
how to remove unwanted zeros from a vector
v = [ 0 0 0 0 4 5 6 0 0 0 9 9 8 7 6 0 0 0 0 0 0 3 4 4 0 0 0]; d = [1 diff(v)]; % 0's indicate when the value didn't cha...

alrededor de 10 años hace | 1

| aceptada

Respondida
How to turn multiple outputs into a array
Assuming Rate_overtime is a function that outputs a double scalar, you could do this: Rate2Graph = zeros(1,N); for n=1:N...

alrededor de 10 años hace | 0

Respondida
Too many input arguments error
It is not clear what "testset" is, but if it is a cell array then the notation you are using in your TestNetwork call will produ...

alrededor de 10 años hace | 0

| aceptada

Respondida
Error with ode45 when solution approaches 0
You've got a 3D 2nd order problem defined (orbit in 3D space), but you are calling ode45 as if you only had a 1D problem to solv...

alrededor de 10 años hace | 1

| aceptada

Respondida
Generating a random number inside a function decleration
Is your rand method even valid for arbitrary size time steps and the intermediate derivatives that ode45 is using internally? T...

alrededor de 10 años hace | 1

Respondida
Using cos function in matrix leads to invalid input character
You have special unprintable characters between the "cos" and the "(" characters, and between the "sin" and the "(". You need to...

alrededor de 10 años hace | 0

Respondida
mtimesx library compile error
TMW changed the way the mex function operates a couple of years ago. Unfortunately at that time I did not have access to recent ...

alrededor de 10 años hace | 1

Respondida
Draw random variables student t distribution
See these links for a description: http://www.mathworks.com/help/stats/trnd.html http://www.mathworks.com/help/stats/stude...

alrededor de 10 años hace | 0

Respondida
Use mex file (mexw64 ormexw32 extension) from Matlab 2011b to Matlab 2015b
mex routines, in general, are not guaranteed to be compatible between different versions of MATLAB. Sometimes you get lucky and ...

alrededor de 10 años hace | 0

Respondida
Field assignment to a non-structure array object.
When the line "p.MarkerSize = bins" is reached, p is a pre-existing variable that is not a struct. So attempting to treat it as ...

alrededor de 10 años hace | 2

| aceptada

Respondida
Efficiently Deleting Matrix Columns/Rows
The above code still works fine for me in R2015a Win32. Maybe you might change the mwSize to size_t, but unless the dimension is...

alrededor de 10 años hace | 2

| aceptada

Respondida
How can I get the min/max value of a particular matrix field over all structures of a cell array
data_struct = [data{:}]; data_v = [data_struct.v]; result = min(data_v(2,:));

alrededor de 10 años hace | 0

| aceptada

Respondida
Matlab Binary Parsing and Type Casting Speedup
One issue is that the lines you highlight are basically data copying. I.e., you copy the data to pick out the segment, then you ...

alrededor de 10 años hace | 1

| aceptada

Respondida
Hi, When I try to to generate a mex files w.r.t to C code , I'm facing an linking error.
The error message basically says that you don't have the entry function "mexFunction" anywhere in your code. I.e., you don't ha...

alrededor de 10 años hace | 0

Respondida
Error: "Not enough input arguments. Error in f (line 2) y = (x.^3) - 2." I also want to verify that this code is using the bisection method to estimate a zero until two successive estimates have a diff. less than 10-6.
You need to have two files for this. One for your function that you intend to find the root of. And another for the script to d...

alrededor de 10 años hace | 0

| aceptada

Respondida
quaterions to string in matlab
I still don't know how your quaternions are stored. Maybe a class object? However, one thing you might try is converting it to a...

alrededor de 10 años hace | 0

| aceptada

Respondida
create sparse upper triangular matrix with only 1s
A sparse version of the full triangular matrix will have slightly over 1/2 of the values, plus some extra overhead for the expli...

alrededor de 10 años hace | 1

| aceptada

Respondida
Connect LeapMotion to Matlab (using C Code or mex files)
If you don't want to go the mex route, and you have library dll's of the functions you want to use, you might try loadlibrary an...

alrededor de 10 años hace | 0

Respondida
Is there a data type has higher precision than double?
You can use the Symbolic Toolbox VPA http://www.mathworks.com/help/symbolic/vpa.html?searchHighlight=VPA Or you can use th...

alrededor de 10 años hace | 0

Respondida
Calcul Speed, Position by acceleration with an accelerometer
Well, what you are currently calculating are *changes* in velocity and *changes* in position, i.e. delta-v and delta-p. To do g...

alrededor de 10 años hace | 0

Respondida
How is matlab using 60% of my CPU?
Without looking at your code in any detail I will offer this comment. Many MATLAB functions (such as matrix multiplication, ele...

alrededor de 10 años hace | 0

Respondida
Can I check that is the output variable same as input variable in mex?
You don't have enough information available (officially) to do what you are trying to do reliably and safely in a mex routine. ...

alrededor de 10 años hace | 1

| aceptada

Cargar más