Question:
Plot a 50Hz sine wave and sample it in 1.25ms intervals in Scilab?
?
2012-11-19 07:50:38 UTC
I m trying to plot a 50Hz sine wave in scilab. The code I have so far is

t=0:%pi/100:2*%pi;
x = sin(t);
plot(t,x);

The problem is when I try to change x = sin(t) to x = sin(2*%pi*f*t) where
f = 50 the graph comes out all weird. I am trying to apply the formula sin(wt)
where w = 2*pi*f but to no avail.

The second part of what I am trying to achieve is to sample this sine wave at 1.25ms intervals.and compute the first 160 samples and plot the result against time. From working it out this should result in 10 cycles for a 50Hz sine wave but I cant seem to achieve this in scilab. It is really annoying me so please help.
Three answers:
My Stalker Misses 99% Of My Comments LOL!
2012-11-19 09:03:43 UTC
Syntax expanded for readability:



x = 0 : %pi/8 : 2 * %pi



y = sin(x)



Plot (x,y)



This will plot one cycle of a 50 Hz wave in 1.25ms increments

(Period of 50 Hz = .02 and 1/16th of .02 is .00125)
?
2016-12-16 12:58:10 UTC
Plot Sine Wave
?
2016-08-04 04:27:11 UTC
The Toiletseat Virus- Stays on your computer for 2 years until it turns into physically fused to your tough pressure. The Microsoft Virus- Takes over files at exponential charges unless it consumes 30 million documents an hour. The Yahoo solutions Virus- Randomly deletes files on the advice of alternative records. The Chuck Norris Virus- Electronically roundhouse kicks your rough pressure to demise. That's all I've acquired for now.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...