linkiorew.blogg.se

Creating a sine wave in mplab xc8
Creating a sine wave in mplab xc8











creating a sine wave in mplab xc8

The code snippet is written to display 2 different sine waves on one common plane sharing a single pair of axes. This can be achieved in a single command as shown in the example given below. Presenting multiple sine waves with a common axisĭisplaying multiple sine waves sharing one set of the common axis is also supported by MATLAB. The second sinusoidal wave with an amplitude of 10 and an angular frequency of 5 is generated in the second cell of the layout.ġ. The first sinusoidal wave is generated in the first cell of the layout with an amplitude of 5 and an angular frequency of 3. The resultant graph contains two different sinusoidal plots created in the same layout. The below code is developed to generate 2 sin waves having values for amplitude as 5 and 10 respectively and angular frequency as 3 and 5 respectively. The feature of generating the multiple numbers of sinusoidal plots with different pairs of axes in the same layout using a single command can be applied using ‘subplot’. Generating multiple sine wave plots with different pair of axes The plot is customized by inserting values for xlabel and ylabel and title of the plot. The resultant sine wave is displayed for the time duration of 0 to 10000 attaining the peak amplitude +1 in the first half cycle and -1 in the second half cycle having linear frequency 10. Plot(t,st), xlabel('time-axis'), ylabel('st'), title('Sine wave'),

  • Grid on: gridlines gets enabled for the sine wave plot.
  • Axis equal: User can create the sine wave plot with common scale factor and spaces for both the axes.
  • Axis square: It enables the user to generate the sine wave in square form.
  • Title: A title gets added to the sine wave plot.
  • It can be achieved by editing the attributes for plot() function. MATLAB incorporates the flexibility of customizing the sine wave graph. The below code is developed to generate sin wave having values for amplitude as ‘1’ and liner frequency as ‘10’. The resultant sine wave is displayed for the time duration of 0 to 2 attaining the peak amplitude +4 in the first half cycle and -4 in the second half cycle with angular frequency 5. The below code is developed to generate sin wave having values for amplitude as ‘4’ and angular frequency as ‘5’. Here are the following examples mention below: Example #1













    Creating a sine wave in mplab xc8