How i can plot anti periodic sine wave in matlab ?

Click For Summary
SUMMARY

The discussion focuses on plotting an anti-periodic sine wave in MATLAB. The user initially attempts to adapt a triangular pulse code using the function tripuls but encounters an error when substituting it with sin. The error message indicates "Too many input arguments," which arises from incorrect usage of the sin function. The correct implementation requires only one argument, which is the angle in radians.

PREREQUISITES
  • Basic understanding of MATLAB programming
  • Familiarity with plotting functions in MATLAB
  • Knowledge of sine wave properties
  • Understanding of aperiodic signals
NEXT STEPS
  • Learn how to use the sin function correctly in MATLAB
  • Research MATLAB's plot function for visualizing different waveforms
  • Explore the concept of aperiodic signals and their mathematical representations
  • Investigate the tripuls function and its applications in signal processing
USEFUL FOR

Students, engineers, and researchers working with MATLAB who need to visualize aperiodic waveforms, specifically sine waves and triangular pulses.

error 401
Messages
19
Reaction score
0
i don't know how i can use MATLAB to plot anti periodic fun ..

the origin site give this code for triangular fun:

fs = 10000;
t = -1:1/fs:1;
x1 = tripuls(t,20e-3);
plot(t,x1), xlabel('Time (sec)');ylabel('Amplitude'); title('Triangular Aperiodic Pulse')


but when i use this for sine wave . i have an error (? Error using ==> sin
Too many input arguments.)

so how i can solve this problem ?

thanx in advance
 
Physics news on Phys.org
error 401 said:
i don't know how i can use MATLAB to plot anti periodic fun ..

the origin site give this code for triangular fun:

fs = 10000;
t = -1:1/fs:1;
x1 = tripuls(t,20e-3);
plot(t,x1), xlabel('Time (sec)');ylabel('Amplitude'); title('Triangular Aperiodic Pulse')


but when i use this for sine wave . i have an error (? Error using ==> sin
Too many input arguments.)

so how i can solve this problem ?

thanx in advance

Can you post the code that you used for the sine wave pulse?
 
the same code but i change tripulse to sin >>

fs = 10000;
t = -1:1/fs:1;

x1 = sin(t,20e-3);
plot(t,x1), xlabel('Time (sec)');ylabel('Amplitude'); title('sin Aperiodic Pulse')
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 139 ·
5
Replies
139
Views
11K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 34 ·
2
Replies
34
Views
12K
  • · Replies 3 ·
Replies
3
Views
3K