Interested in external applications, mex & engine applications with Fortran, C, C++, etc, particularly in the areas of speed improvement and memory management efficiencies.

Answered

Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

You are missing an ending parenthesis, and also you probably need to use element-wise multiply: u3 = exp(-0.89*t) .* (1.75*cos(...

Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

You are missing an ending parenthesis, and also you probably need to use element-wise multiply: u3 = exp(-0.89*t) .* (1.75*cos(...

ungefär 2 timmar ago | 0

| accepted

Answered

Solving a nonlinear ODE

Step 1: Solve your ODE for the highest order derivative, in this case Rdoubledot (on paper) Rdoubledot = stuff (you figure thi...

Solving a nonlinear ODE

Step 1: Solve your ODE for the highest order derivative, in this case Rdoubledot (on paper) Rdoubledot = stuff (you figure thi...

3 dagar ago | 0

Answered

Computational Complexity of matrix multiplication

This question is perhaps more involved than it looks on the surface, because by default MATLAB doesn't store the imaginary part ...

Computational Complexity of matrix multiplication

This question is perhaps more involved than it looks on the surface, because by default MATLAB doesn't store the imaginary part ...

3 dagar ago | 0

| accepted

Answered

error:All functions in a script must be closed with an 'end'.( kindly see the code and help me to remove the error)

Looks like maybe this for iy = 1:H end for ix = 1:W should be just this for iy = 1:H for ix = 1:W Side Note: This would b...

error:All functions in a script must be closed with an 'end'.( kindly see the code and help me to remove the error)

Looks like maybe this for iy = 1:H end for ix = 1:W should be just this for iy = 1:H for ix = 1:W Side Note: This would b...

4 dagar ago | 0

Answered

Using the euler method

p(ip) is the value of p at time t(ip). p isn't a function that you are passing time into like you are doing with p(t(ip)). So ...

Using the euler method

p(ip) is the value of p at time t(ip). p isn't a function that you are passing time into like you are doing with p(t(ip)). So ...

8 dagar ago | 0

Answered

Finding Nonzero Elements in a Vector

You need to wrap this statement with an if-test and only execute it if v(CurrentPosition) is non-zero: prod = prod * v(CurrentP...

Finding Nonzero Elements in a Vector

You need to wrap this statement with an if-test and only execute it if v(CurrentPosition) is non-zero: prod = prod * v(CurrentP...

8 dagar ago | 0

Answered

Markov Chain probability steady state

Hint: The probability of moving from one state to another state in n steps is P^n

Markov Chain probability steady state

Hint: The probability of moving from one state to another state in n steps is P^n

11 dagar ago | 0

Answered

Factorial without the Command

You could use either use a loop to multiply all of the numbers from 1 to n, or use recursion to multiply n by the factorial of n...

Factorial without the Command

You could use either use a loop to multiply all of the numbers from 1 to n, or use recursion to multiply n by the factorial of n...

12 dagar ago | 0

Answered

Inputs a Vector and Returns the Second Smallest Element

Your algorithm always replaces Smallest and SecondSmallest at each iteration. Does that make sense? E.g., if the current Smalle...

Inputs a Vector and Returns the Second Smallest Element

Your algorithm always replaces Smallest and SecondSmallest at each iteration. Does that make sense? E.g., if the current Smalle...

12 dagar ago | 0

Answered

Hex to float like python struct.unpack()

Could be a Big Endian vs Little Endian thing. E.g., inserting a swapbytes( ) step: >> hex = 'C956F53D' hex = 'C956F53D' ...

Hex to float like python struct.unpack()

Could be a Big Endian vs Little Endian thing. E.g., inserting a swapbytes( ) step: >> hex = 'C956F53D' hex = 'C956F53D' ...

12 dagar ago | 0

Answered

Python to MATLAB accuracy

Probably not. The trailing bits of floating point calculations in general can't be trusted. It you change the order of the calc...

Python to MATLAB accuracy

Probably not. The trailing bits of floating point calculations in general can't be trusted. It you change the order of the calc...

12 dagar ago | 0

| accepted

Answered

solving coefficient with linear algebra

You basically have this: [ONES_COLUMN, X_COLUMN, Y_COLUMN] * p = DATA You know all the CAPS stuff. So just use the standard l...

solving coefficient with linear algebra

You basically have this: [ONES_COLUMN, X_COLUMN, Y_COLUMN] * p = DATA You know all the CAPS stuff. So just use the standard l...

14 dagar ago | 0

Answered

Composite Functions with a function with two ranges

For example, take the first one: (g o f)(x) This is just g(f(x)) which is g(x^2) Assuming we are talking only about real in...

Composite Functions with a function with two ranges

For example, take the first one: (g o f)(x) This is just g(f(x)) which is g(x^2) Assuming we are talking only about real in...

18 dagar ago | 0

Answered

im trying to create a while loop for random numbers and it says if its even or odd

Change this while times < 20 to this while Ecounter < 20 and change this Ecounter = 0+1; to this ...

im trying to create a while loop for random numbers and it says if its even or odd

Change this while times < 20 to this while Ecounter < 20 and change this Ecounter = 0+1; to this ...

19 dagar ago | 0

Answered

The Body Mass Index, or BMI

Just get rid of these lines: function BMI=findbmi(Weight,Height)

The Body Mass Index, or BMI

Just get rid of these lines: function BMI=findbmi(Weight,Height)

19 dagar ago | 1

Answered

From where is this exp in syms calculus?

The solution space has multiple values, not just one. The solver has parameterized the solution space for you. There are multi...

From where is this exp in syms calculus?

The solution space has multiple values, not just one. The solver has parameterized the solution space for you. There are multi...

26 dagar ago | 0

| accepted

Answered

simulate a dice throw

doc randi E.g., for a single throw you could use randi(6)

simulate a dice throw

doc randi E.g., for a single throw you could use randi(6)

27 dagar ago | 1

| accepted

Answered

Why do I get "Array indices must be positive integers or logical values" error when using?

k is 3.5 So y(k-1) is y(2.5) and y(k-2) is y(1.5). The indexes are not positive integers, hence the error. Maybe you meant ...

Why do I get "Array indices must be positive integers or logical values" error when using?

k is 3.5 So y(k-1) is y(2.5) and y(k-2) is y(1.5). The indexes are not positive integers, hence the error. Maybe you meant ...

27 dagar ago | 0

| accepted

Answered

How to fill mxArray with mxGetComplexDoubles?

No, this would not be expected to work. In the first place, you need to use mxDOUBLE_CLASS to create the mxArray, not mxSINGLE_...

How to fill mxArray with mxGetComplexDoubles?

No, this would not be expected to work. In the first place, you need to use mxDOUBLE_CLASS to create the mxArray, not mxSINGLE_...

28 dagar ago | 0

| accepted

Answered

The spacecraft free-fall math model

See this link for an example of the parachute problem: https://www.mathworks.com/matlabcentral/answers/516385-code-not-working-...

The spacecraft free-fall math model

See this link for an example of the parachute problem: https://www.mathworks.com/matlabcentral/answers/516385-code-not-working-...

28 dagar ago | 0

Answered

Satellite Orbit, Friction Acceleration Function

See this link for an example that uses atmospheric drag with a satellite (in this case a satellite falling to Earth): https://w...

Satellite Orbit, Friction Acceleration Function

See this link for an example that uses atmospheric drag with a satellite (in this case a satellite falling to Earth): https://w...

28 dagar ago | 0

Answered

Fibonacci Series Using Recursive Function

All of your recursive calls decrement n-1. Eventually you will wind up with the input n=0 and just return v=0, which is not wha...

Fibonacci Series Using Recursive Function

All of your recursive calls decrement n-1. Eventually you will wind up with the input n=0 and just return v=0, which is not wha...

29 dagar ago | 0

Answered

How to fix error: "Index in position 1 is invalid. Array indices must be positive integers or logical values"

Type the following at the command line: dbstop if error Then run your code. When the error occurs, the code will pause with a...

How to fix error: "Index in position 1 is invalid. Array indices must be positive integers or logical values"

Type the following at the command line: dbstop if error Then run your code. When the error occurs, the code will pause with a...

ungefär en månad ago | 0

| accepted

Answered

Why do I get this error message "Array indices must be positive integers or logical values."

You forgot to multiply between the y and (y-1) Z = x(:).^2.*y.*(y-1).*(y+1); Also, make sure to use element-wise operators (wi...

Why do I get this error message "Array indices must be positive integers or logical values."

You forgot to multiply between the y and (y-1) Z = x(:).^2.*y.*(y-1).*(y+1); Also, make sure to use element-wise operators (wi...

ungefär en månad ago | 0

Answered

pointers in object-oriented matlab programing

MATLAB does not have variable pointers ... at least not in the sense of C/C++ like you are probably alluding to.

pointers in object-oriented matlab programing

MATLAB does not have variable pointers ... at least not in the sense of C/C++ like you are probably alluding to.

ungefär en månad ago | 0

Answered

Recursion in matrix calculation

This uses recursive calls (CalDet calls CalDet with smaller matrices until the size is 1x1). I.e., the recursion continues all ...

Recursion in matrix calculation

This uses recursive calls (CalDet calls CalDet with smaller matrices until the size is 1x1). I.e., the recursion continues all ...

ungefär en månad ago | 1

Answered

How C++ gets struct values from Matlab

Looks like your strings are char type and not the newer string type. So you can try the following: mxArray *mx; char *name; ...

How C++ gets struct values from Matlab

Looks like your strings are char type and not the newer string type. So you can try the following: mxArray *mx; char *name; ...

ungefär en månad ago | 0

Answered

Checking whether two complex matrices are equal

You can't rely on floating point calculations to give exact results. See this link: https://ch.mathworks.com/matlabcentral/ans...

Checking whether two complex matrices are equal

You can't rely on floating point calculations to give exact results. See this link: https://ch.mathworks.com/matlabcentral/ans...

ungefär en månad ago | 2

| accepted

Answered

IMU orientation using AHRS filter

I haven't used either of those functions, but from reading the doc maybe you need to use the conjugate of the quaternions in you...

IMU orientation using AHRS filter

I haven't used either of those functions, but from reading the doc maybe you need to use the conjugate of the quaternions in you...

ungefär en månad ago | 1