can any one know how to code for this equation

1 回表示 (過去 30 日間)
navi g
navi g 2017 年 2 月 14 日
編集済み: KSSV 2017 年 2 月 14 日
i also tried to code for this equation but getting error , can anyone help me
this is my program.
>t=0:0.01:10;
L=1.9;
x=(-L/2):0.0019:(L/2);
X=tand(2.42)*(L/2);
w=2*pi()*0.35;
W=2*pi()*0.42;
g=9.81;
n=0:0.1:100;
r=((((-1).^n).*4.*L.*(w.^2).*sin(((2.*n)+1).*pi().*x./L))./((pi().^2).*(((2.*n)+1).^2).*((W.^2)-(w.^2))));
y=sum(r);
N=(w.^2).*X.*sin(w.*t).*(x-y)/g;
..
i should get 1000 r values , i m getting only one know why is this problem

回答 (1 件)

Torsten
Torsten 2017 年 2 月 14 日
編集済み: Torsten 2017 年 2 月 14 日
1. n is integer. So n=0:0.1:100 doesn't make sense.
2. You can't evaluate r for arrays of n and x simultaneously. So loop over different x-values for n=0:100, e.g.
3. In this loop over the x-values, save y in a vector y(loopindex).
Best wishes
Torsten.
  2 件のコメント
navi g
navi g 2017 年 2 月 14 日
編集済み: navi g 2017 年 2 月 14 日
thank u torsten, i tried but no results, do you know how to solve this summation equation .
Torsten
Torsten 2017 年 2 月 14 日
Please show your modified code.
Best wishes
Torsten.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by