From the documentation of sind:
For integers
n,sind(n*180)is exactly zero, whereassin(n*pi)reflects the accuracy of the floating point value ofpi.
So, if you are extremely troubled with the fact that sin( pi ) is not precisly zero, go ahead and use sind, but in practice it is just a wrap-around sin so you actually add a tini-tiny bit of overhead.
Personally, I prefer the elegance of radians and use sin.
MathWorks
mathworks.com › matlab › mathematics › elementary math › trigonometry
sin - Sine of argument in radians - MATLAB
This MATLAB function returns the sine of the elements of X.
MathWorks
mathworks.com › symbolic math toolbox › mathematics › mathematical functions
sin - Symbolic sine function - MATLAB
This MATLAB function returns the sine function of X.
how do you use sin in matlab?
how do you use sin in matlab?. Learn more about sin More on mathworks.com
How to type sin function with square
How to type sin function with square. Learn more about syntax, basic, sinsquare More on mathworks.com
degrees - MATLAB sin() vs sind() - Stack Overflow
Personally, I prefer the elegance of radians and use sin. ... Sign up to request clarification or add additional context in comments. ... I fear that kids that use MATLAB in highschool won't survive to graduation. More on stackoverflow.com
Plotting sin function in matlab
Yes, it is not a sine wave, it shouldn't be. When you add multiple sine waves you get random things, based on how much you add and in what proportion. For eg. Try doing this: for k = 1:N S = S + (1/k)*sin(2pi Fkt) end This will give you triangles. If you do : for k = 1:2:N in the above code, it will be a square wave. But in case of what was asked in the problem, you're supposed to get two impulse in each cycle, with nothing in the middle. The more you increase N, the closer it is to the expected plot as all these are applicable for summation upto infinity. For smaller N, you'll get some disturbance in the middle as it is just an approximate. They are not smaller sine waves, they are just some excess wave that should get eliminated as you increase N. More on reddit.com
Videos
sine wave in matlab 2024 | explained - YouTube
19:27
Matlab #8: Les fonction mathématiques 1/5 - sin(), cos(), exp() ...
05:05
How to Plot Sine Wave in Matlab | Must Watch Tutorial For Beginners ...
18:16
FUNÇÃO PARA SENOIDE REAL NO MATLAB | Fast Lesson #118 - YouTube
02:52
Plotting Sine Wave in MATLAB |MATLAB Tutorial. - YouTube
MathWorks
mathworks.com › matlab › mathematics › elementary math › trigonometry
sind - Sine of argument in degrees - MATLAB
Y = sind(X) returns the sine of the elements in X, which are expressed in degrees.
MathWorks
mathworks.com › fixed-point designer › data type exploration › fixed-point specification › fixed-point specification in matlab › fixed-point math functions
sin - Sine of fixed-point values - MATLAB
Sine of input angle, returned as a scalar, vector, matrix, or multidimensional array.
MathWorks
mathworks.com › matlabcentral › answers › 2049652-how-to-type-sin-function-with-square
How to type sin function with square - MATLAB Answers - MATLAB Central
November 20, 2023 - While the usual mathematical notation to compute the square of the sine of x is , the MATLAB code to perform that computation is sin(x)^2 (or, since you likely want to compute the square of the sine element-wise, sin(x).^2).
MathWorks
mathworks.com › matlab › mathematics › elementary math › trigonometry
asin - Inverse sine in radians - MATLAB
This MATLAB function returns the Inverse Sine (sin-1) of the elements of X in radians.
Reddit
reddit.com › r/ece › plotting sin function in matlab
r/ECE on Reddit: Plotting sin function in matlab
August 14, 2021 -
So I don't know if what I did is correct or what but it does output something. I'm thinking that it's wrong since it doesn't have the "k" that's supposed to be in the equation.
Can someone help me? I know this is just the basics but we're just starting out and I'm already lost on how to do this
the problem my code Top answer 1 of 3
5
Yes, it is not a sine wave, it shouldn't be. When you add multiple sine waves you get random things, based on how much you add and in what proportion. For eg. Try doing this: for k = 1:N S = S + (1/k)*sin(2pi Fkt) end This will give you triangles. If you do : for k = 1:2:N in the above code, it will be a square wave. But in case of what was asked in the problem, you're supposed to get two impulse in each cycle, with nothing in the middle. The more you increase N, the closer it is to the expected plot as all these are applicable for summation upto infinity. For smaller N, you'll get some disturbance in the middle as it is just an approximate. They are not smaller sine waves, they are just some excess wave that should get eliminated as you increase N.
2 of 3
2
Basically what you're doing right now is plotting just one sine wave of frequency F. As the problem asks you to plot sum of N sine waves, you can do a for loop over k. Something like this: S=0 for k=1:N S = S + sin(2 pi F k t); end plot(t,S); Also, I think you need to make a function, so you don't need to have these "input" statements. function S = surname(F,N) %% Your Function Here end
YouTube
youtube.com › watch
How to plot sine wave in matlab | Matlab for beginners | MATLAB TUTORIAL - YouTube
How to plot sine wave in matlab or how to generate sine wave in matlab is a matlab beginners’ tutorial. The initial section of the video explains how to writ...
Published January 2, 2023
MathWorks
mathworks.com › symbolic math toolbox › mathematics › mathematical functions
sinint - Sine integral function - MATLAB
This MATLAB function returns the sine integral function of X.
Johns Hopkins University
math.jhu.edu › ~shiffman › 370 › help › techdoc › ref › sin.html
sin, sinh (MATLAB Function Reference)
Description The sin and sinh commands operate element-wise on arrays. The functions' domains and ranges include complex values. All angles are in radians. Y = sin(X) returns the circular sine of the elements of X.
MathWorks
mathworks.com › matlab › mathematics › elementary math › trigonometry
sinpi - Compute sin(X*pi) accurately - MATLAB
Y = sinpi(X) computes sin(X*pi) without explicitly computing X*pi. This calculation is more accurate than sin(X*pi) because the floating-point value of pi is an approximation of π.
MathWorks
mathworks.com › matlab › mathematics › elementary math
Trigonometry - MATLAB & Simulink
Sine, cosine, and related functions, with results in radians or degrees · The trigonometric functions in MATLAB® calculate standard trigonometric values in radians or degrees, hyperbolic trigonometric values in radians, and inverse variants of each function.
MathWorks
mathworks.com › matlab › mathematics › elementary math › trigonometry
asind - Inverse sine in degrees - MATLAB
Y = asind(X) returns the inverse sine (sin-1) of the elements of X in degrees.
Stack Exchange
math.stackexchange.com › questions › 4528193 › dont-get-what-is-happening-in-matlab-sin-function-need-to-know-difference-be
wave equation - Don't get what is happening in matlab sin() function. need to know difference between sin(2*50*pi*t) and sin(2*1*pi*t) - Mathematics Stack Exchange
$\begingroup$ $\sin(50t)$ has period $\frac{\pi}{25}\approx 0.12,$ and your $t$ is based on increments of $0.1.$ So it will be hard to see the periodic behavior of $\sin(50t).$ $\endgroup$
TutorialsPoint
tutorialspoint.com › matlab › matlab_plot_sine_wave.htm
MATLAB - Plot Sine Wave
The x-axis represents time in seconds, and the y-axis represents the amplitude of the sine wave. When you execute the code the output is as follows − · The ezplot() function in MATLAB is used to plot implicit and explicit equations in 2D. It is particularly useful for visualizing mathematical expressions without the need to explicitly define a function.