"real positive integers or logicals" error

4 visualizaciones (últimos 30 días)
sefa
sefa el 27 de Feb. de 2012
A = 942;
f0 = 19;
w0_1 = 38*pi;
Q_1 = -0.9426;
Q_2 = -0.1678;
t = 0:0.1:5;
cosfn1 = A*cos(2*pi*f0*t + Q_1);
------------------------------
For a cod segment above, I get an error as "Subscript indices must either be real positive integers or logicals." And this points tthe cosfn1. Why do I get such an error? Thanks for your help

Respuesta aceptada

Jonathan Sullivan
Jonathan Sullivan el 27 de Feb. de 2012
do you have a variable named cos?
whos cos
If you do, you will want to clear it out.
clear cos
  1 comentario
Sean de Wolski
Sean de Wolski el 27 de Feb. de 2012
+1.
Sefa, copying and pasting your code above works with no variables named cos()

Iniciar sesión para comentar.

Más respuestas (1)

sefa
sefa el 27 de Feb. de 2012
Thanks for your answer

Categorías

Más información sobre Sensor Models 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!

Translated by