Running this problem an error occurs: ??? Error using ==> rem Not enough input arguments.
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
palak
el 3 de Ag. de 2013
Editada: Walter Roberson
el 10 de Mzo. de 2016
clear all;
clc;
N=20;
if (rem(N,2)==0)
for n= 1:(N+1)/2
b(n)=(2*n)/N;
end
for n=(N/2)+1:N
b(n)=(2*(N-n+1)/N);
end
else
for n= 1:(N+1)/2;
b(n)=(2*n)/(N+1);
end
for n=(N+1)/2:N
b(n)=(2*(N-n+1)/(N+1));
end
plot(b)
xlabel('time samples')
ylabel('amplitude')
title('triangular window')
end
0 comentarios
Respuesta aceptada
Jan
el 4 de Ag. de 2013
If you delete the useless "clear all", you can use the debugger for further investigation:
dbstop if error
Then Matlab stops when the error occurs and you can check in detail, what's going on in the current line of code.
clear all deletes all breakpoints and debugging conditions. Therefore it is a really bad idea.
Más respuestas (2)
Chandrasekhar
el 3 de Ag. de 2013
there are syntax errors in the code. there is no end for the if else statement and no end for the second for loop
clear all;
clc; N=20;
if (rem(N,2)==0)
for n= 1:(N+1)/2
b(n)=(2*n)/N;
end
for n=(N/2)+1:N
b(n)=(2*(N-n+1)/N);
end
else
for n= 1:(N+1)/2;
end
end
1 comentario
Azzi Abdelmalek
el 3 de Ag. de 2013
Editada: Azzi Abdelmalek
el 3 de Ag. de 2013
Type and show the result
which rem
Or check in your current folder if there is a function named rem
3 comentarios
Jan
el 4 de Ag. de 2013
@palak: Please post the complete message. Most of all the failing line is important.
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!