필터 지우기
필터 지우기

How to update old matlab code sel and pck

조회 수: 6 (최근 30일)
BEMNET WONDIMAGEGNEHU MERSHA
BEMNET WONDIMAGEGNEHU MERSHA 2020년 3월 2일
댓글: irem ipek 2023년 10월 30일
I am working on something related with control and I tried to use complex model equation developed by an old matlab version. The resource uses 'sel' and 'pck' code. I believe the 'pck' code is the same as the 'ss' code for state space representation of systems. What does the 'sel' do in this code below? Here this is just part of the code, I have corrected the others
SS_hi = ss(A_hi,B_hi,C_hi,D_hi);
SS_lo = ss(A_lo,B_lo,C_lo,D_lo);
%% Make MATLAB matrix
%%
mat_hi = [A_hi B_hi; C_hi D_hi];
mat_lo = [A_lo B_lo; C_lo D_lo];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Longitudal Directional %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Select the components that make up the longitude A matrix
%%
A_longitude_hi = sel(mat_hi,[3 5 7 8 11 13 14], [3 5 7 8 11 13 14]);
A_longitude_lo = sel(mat_lo,[3 5 7 8 11 13 14], [3 5 7 8 11 13 14]);
%% Select the components that make up the longitude B matrix
%%
B_longitude_hi = sel(mat_hi,[3 5 7 8 11 13 14], [19 20]);
B_longitude_lo = sel(mat_lo,[3 5 7 8 11 13 14], [19 20]);
%% Select the components that make up the longitude C matrix
%%
C_longitude_hi = sel(mat_hi,[21 23 25 26 29], [3 5 7 8 11 13 14]);
C_longitude_lo = sel(mat_lo,[21 23 25 26 29], [3 5 7 8 11 13 14]);
%% Select the components that make up the longitude D matrix
%%
D_longitude_hi = sel(mat_hi,[21 23 25 26 29], [19 20]);
D_longitude_lo = sel(mat_lo,[21 23 25 26 29], [19 20]);
SS_long_hi = ss(A_longitude_hi, B_longitude_hi, C_longitude_hi, D_longitude_hi);
SS_long_lo = ss(A_longitude_lo, B_longitude_lo, C_longitude_lo, D_longitude_lo);
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Lateral Directional %%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Select the components that make up the lateral A matrix
%%
A_lateral_hi = sel(mat_hi,[4 6 7 9 10 12 13 15 16], [4 6 7 9 10 12 13 15 16]);
A_lateral_lo = sel(mat_lo,[4 6 7 9 10 12 13 15 16], [4 6 7 9 10 12 13 15 16]);
%% Select the components that make up the lateral B matrix
%%
B_lateral_hi = sel(mat_hi,[4 6 7 9 10 12 13 15 16], [19 21 22]);
B_lateral_lo = sel(mat_lo,[4 6 7 9 10 12 13 15 16], [19 21 22]);
%% Select the components that make up the lateral C matrix
%%
C_lateral_hi = sel(mat_hi,[22 24 25 27 28 30], [4 6 7 9 10 12 13 15 16]);
C_lateral_lo = sel(mat_lo,[22 24 25 27 28 30], [4 6 7 9 10 12 13 15 16]);
%% Select the components that make up the lateral D matrix
%%
D_lateral_hi = sel(mat_hi,[22 24 25 27 28 30], [19 21 22]);
D_lateral_lo = sel(mat_lo,[22 24 25 27 28 30], [19 21 22]);
SS_lat_hi = ss(A_lateral_hi, B_lateral_hi, C_lateral_hi, D_lateral_hi);
SS_lat_lo = ss(A_lateral_lo, B_lateral_lo, C_lateral_lo, D_lateral_lo);
%% Make longitudal direction SYSTEM matrix
%%
sys_long_hi = pck(A_longitude_hi, B_longitude_hi, C_longitude_hi, D_longitude_hi);
sys_long_lo = pck(A_longitude_lo, B_longitude_lo, C_longitude_lo, D_longitude_lo);
  댓글 수: 3
Manuel Ayala
Manuel Ayala 2020년 5월 18일
Hello, How did you solve this problem? What is the function "sel" and "pck"
Thanks
irem ipek
irem ipek 2023년 10월 30일
Hi! What alternatives can I use in place of 'pck' and 'sel'?

댓글을 달려면 로그인하십시오.

채택된 답변

Maadhav Akula
Maadhav Akula 2020년 3월 4일

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by