Risposto
difference between euler angles and rotation vector
The rotvecd( ) function gives a scaled rotation axis. I.e., what it would take to do a single rotation of an object on all thre...

oltre 5 anni fa | 2

| accettato

Risposto
Cannot input function handles into array
When you do this: basisN0 = @(x)[ 1 ]; basisN1 = @(x)[ 1, x ]; basisN2 = @(x)[ 1, x, x^2 ]; basisN3 = @(x)[ 1, x, x^2, x^3 ]...

oltre 5 anni fa | 0

| accettato

Risposto
Analytically finding the roots of polynomials with symbolic variables
Tell the solve( ) function that the max degree of the polynomial is 3 to force explicit solutions for the result: syms a len p...

oltre 5 anni fa | 0

| accettato

Risposto
Matlab unable to find solution to cubic polynomial
Tell the solve( ) function that the max degree of the polynomial is 3 to force explicit solutions for the result: syms a p = (...

oltre 5 anni fa | 0

| accettato

Risposto
Replacing a for loop with matrix multiplication
result = sum(x.*(inv(SIG)*x)); or result = sum(x.*(SIG\x));

oltre 5 anni fa | 0

| accettato

Risposto
How to find the numerical intersection points for a sine and linear function to find solutions ?
You can't do floating point calculations like this and expect the results to match exactly. You would need to use a tolerance t...

oltre 5 anni fa | 0

Risposto
Solving a Second Order Differential Equation
Here is what I get: >> syms y(t) >> eqn = 4*diff(y,t,2)+32*diff(y,t)+24*y^3 == 192; >> Dy = diff(y,t); >> cond = [y(0)==1.5,...

oltre 5 anni fa | 0

Risposto
Runge Kutta4 for IVP : y' = ty
Good start! Some corrections noted below. This line y0 = exp(1); should be this according to your text y0 = 3; And this li...

oltre 5 anni fa | 0

Risposto
Power Method Eigenvectors Code
The only obvious thing I would note is that the following line doesn't accomplish anything because you don't use err in your cod...

oltre 5 anni fa | 1

Risposto
show probabilities (-inf+inf, -3dev-3dev and so on....)
"Integrating pdf" and "probability ... in given level ranges" sounds like the teacher wants you to use the cdf to get the cumula...

oltre 5 anni fa | 1

| accettato

Risposto
Separation of Variables for 1st Order Differential Equations
Start here: https://www.mathworks.com/help/symbolic/dsolve.html#bve5nw0-1 Case 1: Modifying the example code in the "Solve Di...

oltre 5 anni fa | 0

| accettato

Risposto
Multiple names for a single variable.
There are no "variable pointers" in MATLAB, so no generic alias capability as you would probably want. Other options to conside...

oltre 5 anni fa | 2

Risposto
How to locate and link with the exact same Intel MKL that MATLAB is shipped with?
On my Win64 machine I find them here [matlabroot '/extern/lib/win64/microsoft'] and here [matlabroot '/extern/lib/win64/mingw...

oltre 5 anni fa | 0

Risposto
Use Gaussian Jordan Elimination to convert binary matrix to All zero Matrix
Here is the code, which implements your stated algorithm directly. The input n is the known size of the upper triangular block ...

oltre 5 anni fa | 0

| accettato

Risposto
MATLAB Smallest Integer in floating point number system
IEEE double has a 52-bit mantissa, plus there is a hidden bit, so effectively 53-bit mantissa. So you can exactly represent all ...

oltre 5 anni fa | 0

| accettato

Risposto
Adding 32 to specific indices in a vector
x(y) = x(y) + 32;

oltre 5 anni fa | 0

| accettato

Risposto
Find elements in vector that satisfy condition
X = your big matrix k = column number you want to examine value = some number you are looking for idx = (X(:,k) == value); % ...

oltre 5 anni fa | 0

| accettato

Risposto
Array Cascade Addition calculation
One way using implicit array expansion: D = A(:) + reshape(B,1,[]) + reshape(C,1,1,[]); Your results are the elements of D. I...

oltre 5 anni fa | 0

| accettato

Risposto
Getting NaN in Rung-Kutta 4, Simulation of 10 planets
OK, I will take a look at things. But your attempt at "simplifying" your numbers by using a custom distance unit and apparently...

oltre 5 anni fa | 0

Risposto
Fill in a data vector into a preallocated zeros matrix
m = reshape(v,500001,4);

oltre 5 anni fa | 0

| accettato

Risposto
Multiplication of 2 sets to get all possible outcomes
This is a simple outer product: c = a' * sin(b);

oltre 5 anni fa | 0

Risposto
array indices and bisector method
It is not clear what z is supposed to be used for in these lines: z(xL) = PDFunction (m,k,xL); z(xU) = PDFunction (m,k...

oltre 5 anni fa | 0

Risposto
Matrix multiplication accuracy problem
This difference is this: R0=A'*A; In the above expression, you are using the exact same matrix A on both sides of the operatio...

oltre 5 anni fa | 1

| accettato

Risposto
multiplication of multiple type matrices
Matrix multiplication is associative, so the order of the multiplication doesn't matter mathematically. You might get small dif...

oltre 5 anni fa | 0

Risposto
Advantages of mwsize (Cross-Platform Flexibility)?
"Furthermore, a question arose regarding the 'MATLAB Support for Interleaved Complex API in MEX Functions'. Which API is preferr...

oltre 5 anni fa | 0

| accettato

Risposto
How do i transform a second grade ODE into coordinates?
Looks like motion is restricted to be on the x-y plane, so r is 2D. You have a 2nd order ODE in a 2D frame, so that means you h...

oltre 5 anni fa | 1

| accettato

Risposto
Runge-Kutta 4 implemetation blowing up
s(:,i+1) = s(:,i) + 1/6*(k1 + 2*k2 + 2*k3 + k4); % changed s(:,i+1) to s(:,i) on rhs

oltre 5 anni fa | 0

Risposto
Need help with error checking
There are various ways to code this, but keeping the same basic architecture you have chosen you could do this: while( true ) ...

oltre 5 anni fa | 0

Risposto
Assignment has more non-singleton rhs dimensions than non-singleton subscripts ERROR IN FOR LOOP
x(:,i+1)=x(:,i)+A*x(:,i)+B*u(:,i); % changed u(i) to u(:,i)

oltre 5 anni fa | 0

| accettato

Risposto
Runge Kutta integration problem - NaN result
You may have a stiff DE and you can't use RK4 with a fixed step size. What happens when you call ode45( ) instead of ode15s( )?...

oltre 5 anni fa | 0

Carica altro