Extra dimension on simulink output
显示 更早的评论
I'm running a Simulink model that should send two 3x1 matrices to the workspace. Instead, both of my matrices are 3x1x51, and a corresponding 51x1 matrix called "tout" is produced. How can I prevent my desired matrices from having this third dimension?
采纳的回答
更多回答(1 个)
Alessio Chieffalo
2017-7-13
编辑:Alessio Chieffalo
2017-7-13
I tried your suggested ways about the same problem, but they don't work. I found a solution in the "Model configuration panel" -> "Solver" setting the "stop time" to 0, but the integrator blocks doesn't work (it puts to 0 its own output). This is my code;
clear all
close all
clc
J=[100 0 0
0 100 0
0 0 500];
Omega0=[0.0175 0 -0.0524];
M=[sin(0.01) 0 sin(0.05)];
SimOut=sim('EulerMomentum')
my Simulink model is:

the User-function code in the Simulink model:
function AngAcc = DynamicEq(J_inv,M)
%#codegen
AngAcc=M'*J_inv;
and the outputs are:

What's wrong?
类别
在 帮助中心 和 File Exchange 中查找有关 Sources 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!