Why is my table array not outputting?!
이전 댓글 표시
Hello,
Below is a copy of my code. I can not figure out why the code will not output my table, if you can help it will be most appreciated.
-Robert
CODE:
wn = 5;
za = (5/sqrt(2))/(2*wn);
zb = 5/(2*wn);
zc = (5*sqrt(2))/(2*wn);
zd = (5*sqrt(3))/(2*wn);
ze = 12/(2*wn);
% Peak Times
Tp = [pi/(wn*sqrt(1-za^2)),
pi/(wn*sqrt(1-zb^2)),
pi/(wn*sqrt(1-zc^2)),
pi/(wn*sqrt(1-zd^2)),
pi/(wn*sqrt(1-ze^2))]
% Settling Time
Ts = [4/(za*wn),
4/(zb*wn),
4/(zc*wn),
4/(zd*wn),
4/(ze*wn)]
OptimalSystems = {'System A';'System B','System C','System D','System E'};
Gain = [5/sqrt(2) 5 5*sqrt(2) 5*sqrt(3) 12];
PeakTime = [Tp(1) Tp(2) Tp(3) Tp(4) Tp(5)];
SettlingTime = [Ts(1) Ts(2) Ts(3) Ts(4) Ts(5)];
T = table(OptimalSystems,Gain,PeakTime,SettlingTime)
채택된 답변
추가 답변 (1개)
KSSV
2018년 9월 27일
There were some typo errors and dimension problems.....corrected.
wn = 5;
za = (5/sqrt(2))/(2*wn);
zb = 5/(2*wn);
zc = (5*sqrt(2))/(2*wn);
zd = (5*sqrt(3))/(2*wn);
ze = 12/(2*wn);
% Peak Times
Tp = [pi/(wn*sqrt(1-za^2)),
pi/(wn*sqrt(1-zb^2)),
pi/(wn*sqrt(1-zc^2)),
pi/(wn*sqrt(1-zd^2)),
pi/(wn*sqrt(1-ze^2))]
% Settling Time
Ts = [4/(za*wn),
4/(zb*wn),
4/(zc*wn),
4/(zd*wn),
4/(ze*wn)]
OptimalSystems = {'System A';'System B';'System C';'System D';'System E'};
Gain = [5/sqrt(2) 5 5*sqrt(2) 5*sqrt(3) 12]';
PeakTime = [Tp(1) Tp(2) Tp(3) Tp(4) Tp(5)]';
SettlingTime = [Ts(1) Ts(2) Ts(3) Ts(4) Ts(5)]';
T = table(OptimalSystems,Gain,PeakTime,SettlingTime)
카테고리
도움말 센터 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!