Warning: Input argument might be unused and value assigned might be unused
10 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I got a problem with my code, im trying to do a Fourier series function, but when i instance the function (y) says that might be unused and i dont undertand why.
Also, that happens to my result (s), when i put (s) as a "syms" says that might be unused
function [s]=FourierNuevo(y,T,B,max)
syms x n y s
p=(T-B)/2;
A0=(1/p)*int(y,[-p p]);
an=(1/p)*int(y*cos(pi*n*x/p),[-p p]);
bn=(1/p)*int(y*sin(pi*n*x/p),[-p p]);
As=an*cos(pi*n*x/p)+bn*sin(pi*n*x/p);
s = A0/2 ;
for k=1:max
s=s+subs(As,n,k);
end
end
This is my code. When i run it (y) is used like a constant value. Not like a function
0 Commenti
Risposte (1)
Setsuna Yuuki.
il 30 Ott 2022
Modificato: Torsten
il 30 Ott 2022
Holas.
Quizás es porque tu función
function [s]=FourierNuevo(y,T,B,max)
recibe la variable y, pero despues la estas reemplazando ya que declaras nuevamente y como tipo syms.
syms x n y s
Hello.
Maybe it's because your function
function [s]=FourierNew(y,T,B,max)
receives the variable y, but then you are replacing it since you declare again y as type syms.
syms x n y s
0 Commenti
Vedere anche
Categorie
Scopri di più su Calculus in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!