Community Profile

photo

Elisee Yanna


Active since 2017

%Aufgabe5 teil a Trapezregel
function[A]=trapzregel(a,b,N)

dt=((b-a)/N )% dt=h= (b-a) ist die Trapezbreite
x=a:dt:b; % Schritte
f=@(x){10*sin(x)./x}; %gegebene Funktion
%a,b sind die Integrationsgrenzen
%plot(fx,'r')
% N ist die Zahl der Intervallen
A=0;
for(n=1:1:N)

%plot(fx,'r')

A=A+{dt/2}*{f(a)+f(a+dt)}
a=a+dt;

end

i get this failed after plotting my Code.
what is wrong in my Code? i can t fund the faillure now 2 days.I need some Help.
Thank You

Undefined operator '+' for input arguments of type 'cell'.

Error in trapzregel (line 15)
A=A+{dt/2}*{f(a)+f(a+dt)}

Statistics

  • Thankful Level 1

View badges

Content Feed

View by
No Activity