Array indices must be positive integers or logical values.
Afficher commentaires plus anciens
syms s;
t=10:0.1:100;
impulse=t==0;
f=32/(s-8);
y=subs(f,s,t);
impulse(y);
plot(y,[impulse]);
xlabel('x');
ylabel('y');
Array indices must be positive integers or logical values.
someone know how is this? i am starting with matlab i dont know why this happening.
4 commentaires
syms s
t=10:0.1:100;
impulse=t==0;
f=32/(s-8);
y=subs(f,s,t)
impulse(y)
What do you expect an index of e.g. 320/21 to return?
Walter Roberson
le 1 Oct 2022
impulse=t==0;
That assigns impulse to be a variable, overriding its existence as a function. Within the rest of the scope, you can no longer call impulse as a function.
KSSV
le 2 Oct 2022
You need to define impulse properly. What is impulse?
Réponses (0)
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!