![photo](/responsive_image/150/150/0/0/0/cache/matlabcentral/profiles/5237160_1522107028762_DEF.jpg)
Elisee Yanna
Followers: 0 Following: 0
%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
1 Question
0 Answers
RANK
213,001
of 297,046
REPUTATION
0
CONTRIBUTIONS
1 Question
0 Answers
ANSWER ACCEPTANCE
100.0%
VOTES RECEIVED
0
RANK
of 20,422
REPUTATION
N/A
AVERAGE RATING
0.00
CONTRIBUTIONS
0 Files
DOWNLOADS
0
ALL TIME DOWNLOADS
0
RANK
of 157,776
CONTRIBUTIONS
0 Problems
0 Solutions
SCORE
0
NUMBER OF BADGES
0
CONTRIBUTIONS
0 Posts
CONTRIBUTIONS
0 Public Channels
AVERAGE RATING
CONTRIBUTIONS
0 Highlights
AVERAGE NO. OF LIKES
Feeds
Question
what is wrong in my code trapezoidal rule
%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; % Sch...
7 years ago | 1 answer | 0