MATLAB: Pulse disturbance signal generator

MATLABpulse disturbancepulse generatorsimulation

Hi Please can anyone help on how to generate a pulse disturbance to test the robustness of my second order sliding mode control system. My system runs fine for 10,000 seconds. I need to apply pulse distrubance to test the robusteness. However, I could only add pulse disturbace that run the entire time of the simulation time which is 10,000 seconds. I believe disturbance should just run a fraction of the entire simulation time. for instance for 100s out of the 10,000s simulation time. Please how do i generate such pusle disturbance that would not run the entire simulation time. I want it to run for may be 100 seconds or 200s of the 10,000 seconds of the simulation time.
thank you

Best Answer

How are you running your simulation? Is it in Simulink?
In Simulink you can use a From Workspace block to create an arbitrary signal. Use this to create your desired disturbance and connect it appropriately in your diagram to apply the disturbance.