- 'Dirac function': https://in.mathworks.com/help/symbolic/sym.dirac.html
- 'Sum function': https://in.mathworks.com/help/matlab/ref/sum.html
How draw on-off singal in Matlab.
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I want to graph this function in Matlab, but I don't know how to code the sigma delta part. Help me.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/995820/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/995820/image.png)
0 Kommentare
Antworten (1)
Balavignesh
am 26 Sep. 2023
Bearbeitet: Balavignesh
am 27 Sep. 2023
Hi Soo,
I understand that you want to know how to define "dirac-delta" and "sigma" in MATLAB.
I suggest you to use "dirac" function to define the "dirac-delta" function. Although there is not any specific function to define "sigma" over a infinite range, you can use "sum" function to get a close approximation.
After you declare a range of values for "w", you can then use a for loop and store the values of "Sy(w)" in an array to plot your desired function.
Here is an example code showing how you can do it:
% Initializing with some Trash Values. Input your own data.
w = 0:100 ;
n = -100 : 100;
Tb = 0.6
Sy = zeros(1,length(w)); % Pre-allocating 'Sy' for faster computation
% Computing values of Sy. This is just a part of computation.
for i = 1:length(w)
Sy(i) = sum(dirac( w(i) - (2*pi*n)/Tb));
end
% Plot Sy against w
Please refer to the following documentation links to know more about:
0 Kommentare
Siehe auch
Kategorien
Mehr zu Axis Labels 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!