How to generate the rectangular signal from the image below using square function :
Mostrar comentarios más antiguos

2 comentarios
Image Analyst
el 20 de Mzo. de 2021
How did you create the image in the first place? Since you created it, you must have the data. Why do you need to go from saved screenshot image to data when you should already have the data?
Sirbu Vladimir
el 20 de Mzo. de 2021
Respuestas (2)
Cris LaPierre
el 20 de Mzo. de 2021
Editada: Cris LaPierre
el 20 de Mzo. de 2021
0 votos
Your teacher has gone so far as to even tell you what function to use. If you'd even looked at the documentation for square, you'd have the answer to your question already.
Image Analyst
el 20 de Mzo. de 2021
Editada: Image Analyst
el 20 de Mzo. de 2021
So you DON'T need to generate the array from doing image processing on the image itself. You just have to create an array that, when plotted, would look like the image. So I imagine he told you about the zeros() function for creating an array 70 long, and the equals operator to assign indexes from 20 to 40 to 1. So in 4 very simple lines of code, you should be able to do it.
y = zer............
y(.......... = ........
plot(y................
grid on
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!