When simulating the response to a specific input signal, the input data U must be a matrix with as many rows as samples in the time vector T

조회 수: 2 (최근 30일)
Hi, this error is occurred.
Error using DynamicSystem/lsim
When simulating the response to a specific input signal, the input data U must be a matrix with as many rows as samples in the time vector T, and as many columns as input channels.
Error in untitleds (line 321)
[Responset_q_equi] = lsim(sysansq_equi , INPUT_equi , tempo);
I thought of solving by considering INPUT_equi as a 5-row vector, since the state space matrix B has 5 columns, and 1 column using function repmat but it doesn't work :( even considering the number of lines equal to that of the elements of the time vector does not work
This is the script (sysansq_equi is already defined in the previous part of the script that is not reported here)
%DEFINIZIONE ingressi nel tempo
%load(['Published/','accDX_equi_QUARTER_CAR.dat'])
INPUT_DX_equi_QUARTER_CAR = accDX_equi_QUARTER_CAR(:,2);
tempo = accDX_equi_QUARTER_CAR(:,1); % è uguale per ogni caso avendo ip. per ogni caso v = 4 m/s
% cioè 14.4 km/h
dt=mean(diff(tempo)); %calcola la media degli incrementi tra tempo(i) e tempo(i+1) per ogni i
Fmax=1/(2*dt); % Nyquist -- Fmax = Fc/2
%load(['Published/','accSX_equi_QUARTER_CAR.dat'])
%INPUT_SX_equi_QUARTER_CAR = accSX_equi_QUARTER_CAR(:,2);
max(accDX_equi_QUARTER_CAR(:,2))
%max(accSX_equi_QUARTER_CAR(:,2))
INPUT_equi = INPUT_DX_equi_QUARTER_CAR;
[Responset_q_equi] = lsim(sysansq_equi , INPUT_equi , tempo);
figure (9)
plot(tempo,Responset_q_equi)
xlabel('Tempo [s]')
ylabel('q')
grid on
legend('q1','q2','q3','q4','q5','q6','q7','q8','q9','q10')
title('Coordinate normali caso equiripartito')

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by