How to solve an equation using numerical solver in Matlab?
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
Hi everyone,
I want to solve this equation using numerical solver. I have value of R and want to calculate the coressponding value of n using numerical solver.
May someone help me here ......
R =1/n^2 [(n+1)ln(n+1)-n]
採用された回答
Alan Stevens
2020 年 9 月 30 日
Look up documentation on fzero.
11 件のコメント
aa
2020 年 9 月 30 日
I have no initial point to solve this ....
>> x = fzero(@(x)x^(-2)*((x+1)*ln(x+1)-x)-0.44999)
Error using fzero (line 118)
The input should be either a structure with valid fields or at least two arguments to FZERO.
Alan Stevens
2020 年 9 月 30 日
Plot a curve of the right hand side Vs n, to see roughly where it equals R.
Alan Stevens
2020 年 9 月 30 日
You need to supply an initial guess. Also MATLAB use log not ln, for log to the base e.
aa
2020 年 9 月 30 日

Alan Stevens
2020 年 9 月 30 日
You need to pass the initial guess to fzero as its second argument.
aa
2020 年 9 月 30 日
see i guess x=5 but still did not get the answer....
Try
R = 0.44999;
f = @(n) ((n+1).*log(n+1)-n)./n.^2 - R;
n0 = 1; % Initial guess
n = fzero(f,n0);
disp(n)
aa
2020 年 9 月 30 日
May you help me in generalizing this programme for large number of values. For example, I have more tahn 500 values of R and I want to calculate n for each values of R ....
John D'Errico
2020 年 9 月 30 日
But what is wrong with writing a loop? Just wrap that code inside a loop, where you change R each time through.
aa
2020 年 9 月 30 日
Earlier my code did not work with the loop but now I have fixed the error... it works perfectly .. Thanks
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Mathematics についてさらに検索
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
