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)}
統計
1 質問
0 回答
ランク
of 171,294
コントリビューション
0 問題
0 解答
スコア
0
バッジ数
0
コントリビューション
0 投稿
コントリビューション
0 パブリック チャネル
平均評価
コントリビューション
0 ハイライト
平均いいねの数
Feeds
質問
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...
約8年 前 | 1 件の回答 | 0
