Respondida
error decimal aproximation, extra decimal
Welcome to the world of floating point arithmetic! See this link: https://www.mathworks.com/matlabcentral/answers/57444-faq-wh...

alrededor de 6 años hace | 0

Respondida
For loop for multiple scenarios
E.g., for k=1:numel(h_max) % use h_max(k), a_max(k), and SM(k) in your code here end Or if they need to vary independent...

alrededor de 6 años hace | 0

Respondida
How to write a function to determine if the inputed date is valid.Whats wrong with my valid_date function?
Consider these lines: if( any(month == [4,6,9,11]) && day<=30 ) % <-- if you pass this test valid = true; ...

alrededor de 6 años hace | 0

Respondida
calculate the probability of tomorrow's climate
The normal distrubion is a continuous distribution. To answer questions like "probability of temp greater than" or "less than"...

alrededor de 6 años hace | 0

Respondida
how can I display my result: the problem on fprintf command
The format string is first, not last. E.g., fprintf('%s\n\r', expo_result);

alrededor de 6 años hace | 0

| aceptada

Respondida
Out of memory Problem [Problem 2 , Project Euler (Sum of even Fibonacci numbers)]
Don't store all of the numbers as you go and then add them up at the end. Only keep a few numbers in memory at one time and do ...

alrededor de 6 años hace | 0

Respondida
What is the convention of the new quaternion( ) class introduced in R2018b?
The new quaternion( ) class introduced in R2018b is a generic class. The functions it uses can be made to be consistent with qu...

alrededor de 6 años hace | 1

Pregunta


What is the convention of the new quaternion( ) class introduced in R2018b?
MATLAB introduced a new quaternion( ) class in R2018b. How does this compare to other existing quaternion functionality in MATL...

alrededor de 6 años hace | 1 respuesta | 1

1

respuesta

Respondida
how to convert a rotation matrix to a rotation vector
I can't find the computeRotationVectorForAnglesCloseToPi( ) function. Where is this from? The "(w,v) is a unit quaternion" sta...

alrededor de 6 años hace | 0

Respondida
Matrix Error when typed in
This is just a display issue. All values are what you entered (or, at least the closest IEEE double representation). That 1.0e...

alrededor de 6 años hace | 0

Respondida
Can we solve this problem without using sort?
Introductory programming classes usually start with the bubble sort. See here for the algorithm in pseudo-code: https://en.wik...

alrededor de 6 años hace | 0

Respondida
How can I add a column to existent 3D matrix
First, you need to realize that the size of your insert will be 180 x 1 x 107. I.e., it is not just a 180 element column you ne...

alrededor de 6 años hace | 0

| aceptada

Respondida
Ambiguity in DCM to Quaternion conversion using the default Simulink library block
Quaternions used for rotations have an inherent sign ambiguity, as you seem to already know. That is, -q produces the same rota...

alrededor de 6 años hace | 0

Respondida
Why is the Euler Output of the Quaternion Block different than the Euler Angles block in the Aerospace Blockset?
On a related note, the Aerospace Toolbox uses a different quaternion convention than the Robotics Toolbox. One is basically the...

alrededor de 6 años hace | 0

Respondida
rotate a vector by orientation defined by Euler angles
MATLAB uses two different quaternion conventions in their toolboxes. The Aerospace Toolbox quaternion convention is essentially...

alrededor de 6 años hace | 0

Respondida
Is quaternion multiplication associative?
You just need to simplify it to see that the result is in fact 0's. E.g., running your code gives this for X-Y: ans = [ cos(t...

alrededor de 6 años hace | 0

Respondida
how to make Ascii 7 bit in matlab
MATLAB uses ASCII for encoding characters. So you can just do this to get the characters: ASCII = char(0:127);

alrededor de 6 años hace | 0

Respondida
Get the factorial of an array
The factorial( ) function is vectorized, so just call it: >> n = [1 9 1 3 7 2 5 4 0 9]; >> factorial(n) ans = Columns 1 t...

alrededor de 6 años hace | 2

Respondida
Commands for Simulations using Quaternions
Not to be flippant, but the cheapest way is to not buy a toolbox just for the functions you need, but simply write your own func...

alrededor de 6 años hace | 1

Respondida
Feedback control - need to update an algebraic variable within ODE function.
I think you are using the wrong tool for this. ode45( ) is an adaptive integrator, which means that it has the freedom to chang...

alrededor de 6 años hace | 1

Respondida
general vector code question
MATLAB does not support the i, j, k quaternion "complex" numbers. The i and j in MATLAB are strictly the ordinary imaginary num...

alrededor de 6 años hace | 0

Respondida
help With rotating vectors
We need more detail. Your quat_2_new is a unit quaternion, so it can be used for rotations. If your quat_1 is just supposed to...

alrededor de 6 años hace | 0

Respondida
quat2eul(quat) and dcm2Angle(R) difference for ZYX sequence
MATLAB uses two different quaternion conventions in their toolboxes. In particular, the quaternion convention used in the Aeros...

alrededor de 6 años hace | 1

| aceptada

Respondida
Memory allocation for structure array
The 112 I think is an estimate of the size of an mxArray header (the internal structure for each variable that MATLAB uses behin...

alrededor de 6 años hace | 1

Respondida
using logic with units - can it be done?
Don't use == for single quoted strings, since that will do an element-by-element calculation. So this if (data.units == 'm/s')...

alrededor de 6 años hace | 0

| aceptada

Respondida
Why do i keep getting this," Incorrect use of '=' operator." error?
This is not valid MATLAB syntax: for m=1:M & n=0:N Maybe you wanted nested for loops? for m=1:M for n=0:N z = z+...

alrededor de 6 años hace | 0

| aceptada

Respondida
Add Consecutive Numbers sent to a Matrix in a Matlab Function
Sounds like maybe you want persistent variable behavior. E.g., function travel_dist = DeltaDistance(x) persistent y if( isemp...

alrededor de 6 años hace | 0

| aceptada

Respondida
Recursive definition of anonymous function
@(x) STUFF Takes a snapshot of all of the workspace variables used in STUFF in order to create the function handle. It doesn't...

alrededor de 6 años hace | 1

| aceptada

Respondida
help PLease, RK4!
You left out some * operators on the k2 and k3. This fy = @(time,x1,x2,x3) m2*x2+c3*(x2-x3)+c2*(x2-x1)+k3*(x2-x3)+k2(x2-x1); f...

alrededor de 6 años hace | 1

Respondida
OpenMP in mex file only produces 1 thread
What if you try to force it? E.g., #pragma omp parallel num_threads(omp_get_max_threads()) Or maybe omp_set_num_threads(omp_...

alrededor de 6 años hace | 1

| aceptada

Cargar más