Problems with Matix Manipulation

2 visualizaciones (últimos 30 días)
DJ V
DJ V el 4 de Sept. de 2024
Movida: Voss el 4 de Sept. de 2024
I copied this routine, so I'm not that familiar with it. It appers to have some errors built in. Matlab is giving me the following errors:
Error using vertcat
Dimensions of arrays being concatenated are not consistent.
Error in EqnsOfMotionbackup>translate (line 322)
XYZ = XYZ + repmat([pn;pe;pd],1,size(XYZ,2));
Error in EqnsOfMotionbackup>drawPlaneBody (line 241)
NED = translate(NED, pn, pe, pd);
Error in EqnsOfMotionbackup (line 209)
handle = drawPlaneBody(pn,pe,pd,phi,theta,psi,handle);
Can anyone help me to identify the specific errors?
Code is attached.

Respuestas (1)

Voss
Voss el 4 de Sept. de 2024
Movida: Voss el 4 de Sept. de 2024
If you execute
dbstop if error
on the command line and then run the script, the debugger will stop on line 322, which is
XYZ = XYZ + repmat([pn;pe;pd],1,size(XYZ,2));
If at that point you execute
whos
on the command line, you'll see this:
K>> whos
Name Size Bytes Class Attributes
XYZ 3x39 936 double
pd 1x101 808 double
pe 1x101 808 double
pn 1x1 8 double
which tells you that pn, pe, and pd cannot be vertically concatenated, i.e., this part
[pn;pe;pd]
is not going to work, since they don't have the same number of columns. That's the reason for the specific error.

Categorías

Más información sobre Mathematics and Optimization en Help Center y File Exchange.

Productos


Versión

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by