photo

Elisee Yanna


Active since 2017

Followers: 0   Following: 0

Message

%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

MATLAB Answers

1 Question
0 Answers

RANK
105.543
of 300.338

REPUTATION
0

CONTRIBUTIONS
1 Question
0 Answers

ANSWER ACCEPTANCE
100.0%

VOTES RECEIVED
0

RANK
 of 20.922

REPUTATION
N/A

AVERAGE RATING
0.00

CONTRIBUTIONS
0 Files

DOWNLOADS
0

ALL TIME DOWNLOADS
0

RANK

of 168.149

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

  • Thankful Level 1

View badges

Feeds

View by

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...

bijna 8 jaar ago | 1 answer | 0

1

answer