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 visualizaciones (últimos 30 días)
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.

Respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by