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...

21 dagen ago | 0

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; ...

21 dagen ago | 0

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"...

21 dagen ago | 0

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);

22 dagen ago | 0

| accepted

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 ...

22 dagen ago | 0

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...

23 dagen ago | 1

Question

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...

23 dagen ago | 1 answer | 1

### 1

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...

23 dagen ago | 0

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...

23 dagen ago | 0

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...

23 dagen ago | 0

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...

23 dagen ago | 0

| accepted

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...

24 dagen ago | 0

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...

24 dagen ago | 0

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...

25 dagen ago | 0

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...

25 dagen ago | 0

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);

25 dagen ago | 0

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...

25 dagen ago | 1

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...

26 dagen ago | 1

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...

26 dagen ago | 1

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...

26 dagen ago | 0

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...

26 dagen ago | 0

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...

26 dagen ago | 1

| accepted

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...

26 dagen ago | 1

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')...

26 dagen ago | 0

| accepted

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+...

26 dagen ago | 0

| accepted

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...

27 dagen ago | 0

| accepted

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...

27 dagen ago | 1

| accepted

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...

27 dagen ago | 1

OpenMP in mex file only produces 1 thread

28 dagen ago | 1

| accepted