Warning: Input argument might be unused and value assigned might be unused
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Setsuna Yuuki.
am 30 Okt. 2022
Bearbeitet: Torsten
am 30 Okt. 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 Kommentare
Siehe auch
Kategorien
Mehr zu Calculus finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!