I am writing a MATLAB function that takes in a 3x3 matrix and should output the matrix's eigenvalues and left eigenvectors. However, my function right now is only outputting the first output variable. I've tried to debug, but no matter what, it always only outputs the first output variable (scalar or vector). Is there a clear syntax error that I am missing?
function [sigma1,sigma2,sigma3,m1,m2,m3] = determinePrincipalState(s11,...
s12,s13,s21,s22,s23,s31,s32,s33)
% determinePrincipalState takes a 3x3 stress tensor and computes the
% principal stresses and directions.
% Set up stress tensor
sigma = [s11 s12 s13; s21 s22 s23; s31 s32 s33];
% Calculate eigenvalues and eigenvectors (column vectors)
[R V L] = eig(sigma);
% Define outputs
sigma1 = V(1,1); sigma2 = V(2,2); sigma3 = V(3,3);
m1 = [L(1,1); L(2,1); L(3,1)];
m2 = [L(1,2); L(2,2); L(3,2)];
m3 = [L(1,3); L(2,3); L(3,3)];
end