Simulink timeseries conversion into matrix

조회 수: 8 (최근 30일)
Rutwesh Shirbhate
Rutwesh Shirbhate 2021년 2월 28일
편집: Rutwesh Shirbhate 2021년 2월 28일
Hello,
I have a timeseries of Y positon output from simulink block. Y in converging to the steady state from t = 0 to t =50. I want to calculate the root mean square deviation(RMSD) of every second of input Y while simulating and check when it drops below the set thrushhold of RMSD. How to create a matrix of elements for each second and calculate the RMSD. When thrushhold for RMSD is reached output from matlab function should be 1 else 0.
This is how I post processed the data after importing into matlab from simulink. The same has to be implemented in simulink.
time = Y_position.Data(3500:end,1);
v = Y_position.Data;
mean = 2.063;
a = (time + mean);
N = size(time);
for ii = 1:N
b(ii,1) =(a(ii,1) )^2;
sumb = sum(b);
end
c = sum(a);
MSE = sumb/N(1,1) % Mean square error (MSE)
RMSD_ = sqrt(MSE) % Root Mean square Deviation (RMSD)

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by