syms ax ay az bx by bz k doublea=[ax ay az]'au=a./sqrt(ax^2+ay^2+az^2)b=[bx by bz]'bu=b./sqrt(bx^2+by^2+bz^2)R=[bu(1)*au(1) bu(1)*au(2) bu(1)*au(3); bu(2)*au(1) bu(2)*au(2) bu(2)*au(3); bu(3)*au(1) bu(3)*au(2) bu(3)*au(3)]c=R*a;Crotated = c;matlabFunction(Crotated,'file','testMatrix.m')aa = [200. 100. 0.1];bb = [200.13 99.995 0.12];cc = [aa,bb]Crotated(cc)
The error is:
Error using sym>checkindex (line 2429)Index must be a positive integer or logical.Error in sym>privformatmatrix (line 2387) checkindex(x);Error in sym>privformat (line 2362) s = privformatmatrix(x);Error in sym/subsref (line 1578) [inds{k},refs{k}] = privformat(inds{k});Error in rotations (line 26)Crotated(cc)
Other times I got the error "Not enough input arguments". If I debug the program it seems that all the values are considered by Matlab to be the first variable in the function's list of variables. The other 5 are considered to be empty and I got the error. I've read some other similar questions, but didn't find a answer. Please explain, or name a simple solution to 'split' the values and give them to the other variables (from the function's list of input variables).
Best Answer