Filter löschen
Filter löschen

Problems with drawing diagrams in MATLAB

1 Ansicht (letzte 30 Tage)
Khashayar K
Khashayar K am 8 Jun. 2018
Kommentiert: Walter Roberson am 12 Jun. 2018
I'm completely new to MATLAB, and I need help with diagrams. I have to compare and draw 3 different wave equations in one diagrams. How can I do so? Or if possible can anyone send the code? Here are the equations:
  1. Y1= 11.5sin((2πλ/4.97) + 63.3)
  2. Y2= 14.6sin((2πλ/10.5) + 45.8)
  3. Y3= 7.36sin((2πλ/4.97) + 63.3)

Antworten (1)

Nithin Banka
Nithin Banka am 8 Jun. 2018
Refer to Hold documentation. Example:
x = linspace(-pi,pi);
y1 = sin(x);
plot(x,y1)
hold on
y2 = cos(x);
plot(x,y2)
hold off
  3 Kommentare
Nithin Banka
Nithin Banka am 12 Jun. 2018
Bearbeitet: Nithin Banka am 12 Jun. 2018
The size of 'lambda' and size of 'x' must be same. Use size() function to find their sizes. Since in your case 'y1 or y2 or y3' does not depend on 'x' try changing the size of 'x'.
Walter Roberson
Walter Roberson am 12 Jun. 2018
lambda = linspace(-pi,pi);
y1 = 11.5*sin(2*pi*lambda/4.97 + 63.3);
plot(lambda, y1)

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Line Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by