I want to plot a square wave using for loop method. It is not the sine wave converted to square wave. The wave don't have negative values.
5 views (last 30 days)
Show older comments
i am using t = [0:0.01:1]; x = 1:100; for i = 1:length(x); fi(i) = 1*x(i); end fi(i) plot(t,x,'b') I know the vectors are not of same length. the idea that i have is, i x-y axis graph, when x=c, it is a straight line on x-axis, now i want to repeat this 100 times using for loop, and again repeating this 2 times. the x-axis will be labelled as time interval. please help m execute this idea. thank you in advance please help me to execute this idea.
0 Comments
Answers (0)
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!