running it an error occurs as follows:??? Subscript indices must either be real positive integers or logicals. Error in ==> hanningwindow at 15 y(f)=20*log(abs(b));
Show older comments
clear all;
clc;
N=input('enter the value of N=')
n = 0:N-1;
b = 0.5*(1 - cos(2*pi*n/(N-1)));
plot(n,b)
xlabel('time samples')
ylabel('amplitude')
figure
f=0:N-1;
fmax=max(f);
m=f/fmax;
y(f)=20*log(abs(b));
plot(m,y)
xlabel('normalized frequency')
ylabel('magnitude')
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!