(Solved): (4b) Start MATLAB running on the PC by the command: MATLAB This puts you in the command mode of MAT ...
(4b) Start MATLAB running on the PC by the command: MATLAB This puts you in the command mode of MATLAB. Get to know MATLAB by trying out a few basic commands: Commands Remarks A=[1?2;3?4?]B=eye(2)C=A+BD=[A?B?]F=[A;B]kT=0:0.05:1y=[] for t=kT,y=[ysin(2?pi?t)] end plot (kT,y)? defines a 2×2 matrix called AB=2×2 identity matrix C= matrix sum of A&BD= matrix formed by putting A&B side by side F= matrix formed by putting A on top of BkT=[0?0.050.100.15…1. ?]y= empty matrix Start for-loop: set t successively to elements of kT compute sin(2?t) and accumulate the results in y end of for-loop plot y against kT? MATLAB supports the running of commands from a macro-file (a script file containing MATLAB commands) which can be created using any text editor. (4c) Write a macro-file program to simulate the step response of the closed-loop system using the discrete-time state-space model obtained. Run your program and check whether the simulation result agrees with the experimental result.
1.The system matrices should be defined.2.Set the system's sample period, represented by Ts.3.Define N, the total number of simulation steps.4.Define the system's starting state, represented by the symbol x0.