I want the right coding for ploting a horizontal line with sin wave

Pl I want the code of plotting horizontal line with sin wave in the same figure

3 Commenti

Since this is surely homework, what have you tried? If nothing, why not?
  1. Surely you can you plot a sine wave?
  2. Can you plot a horizontal line? Hint, either use plot, or use yline.
If you will use plot to plot both of the curves, then you need to use hold on to force the second plot to overlay the first. But yline does not require you to use hold.
I know how to plot sin but I could put the horizontal line with it I don’t know how to code it
dpb
dpb il 21 Mar 2021
Modificato: dpb il 21 Mar 2021
Perhaps it's hold you may be unaware of????
Again, "show your work!"

Accedi per commentare.

Risposte (1)

Hello!
hold on
plot([x1,x2], [y,y])
Line starts in [x1, y] point and ends in [x2, y] point.

Tag

Richiesto:

il 21 Mar 2021

Modificato:

il 21 Mar 2021

Community Treasure Hunt

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

Start Hunting!

Translated by