Question: I am getting an error on my MATLAB code. The following functions are giving me an error that says Invalid text character. Check for unsupported
I am getting an error on my MATLAB code. The following functions are giving me an error that says Invalid text character. Check for unsupported symbol, invisible character, or pasting of nonASCII characters. I don't know which symbol it is talking about. vBody and vRef are x matrices. You can make them up to run this code.
functionAdavenport,difflambda,qhatdavenportmethodvBodyvRef
Initializing arrays
z zeros;
Bmat zeros;
nostars lengthvBody;
Creating for loop to find B and z of the Davenport's qmethod
for i :nostars
Extracting the vectors
b vBody: i;
r vRef: i;
Creating the B matrix
Bmat Bmat b r;
Creating the z vector
z z crossb r;
end
Calculating the K matrix
K Bmat Bmat' traceBmat eye;
Kmat K z ; z traceBmat;
Finding the eigenvalues and q vectors
qvec, eigs eigKmat 'vector';
Finding the biggest eigenvalue and its q vector
lambda i maxeigs;
q qvec: i;
qhat q normq;
Calculating the DCM using the function
Adavenport qDCMq;
Confirm that lambdadave is close to lambda
lambdainit nostars;
difflambda lambdainit lambda;
end
function skewmat Skewv
This function creates the skew symmetric matrix of a vector
skewmat v v; vv; v v;
end
function A qDCMq
This function creates the rotation matrix by multiplying two matrices
Calculating psi and dont know what it is called
psi q eye Skewq:; q:;
greekletter q eye Skewq:; q:;
DCM
A greekletter' psi;
end
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
