Completely Solved C, C++ Programs Assignment.




Plotting of a unit step starting at t=2 and going to right.

Filed Under: ,

Problem 1 [ A1 P1 ] : Plotting of a unit step starting at t=2 and going to right.
Program:
X=1
for I=1:1000;
T(I) = I * 0.01;
if T(I)<2
U(X)=0;
else
U(X)=1
end
X=X+1;
end
plot(T,U);
hold
plot(0,2);
xlabel('X->');
ylabel('Y->');

Output:


Get Free Programming Tutorials and Solved assignments