フィルターのクリア

Folsve issues in function definition

1 回表示 (過去 30 日間)
Honey Adams
Honey Adams 2018 年 8 月 6 日
コメント済み: Honey Adams 2018 年 8 月 6 日
I have a system of nonlinear equations and I am trying to solve with the fsolve solver. I defined the function and the variables in the function but I had an error. Attached is the Matlab code of the function. I would be glad for any assistance.

採用された回答

Stephen23
Stephen23 2018 年 8 月 6 日
編集済み: Stephen23 2018 年 8 月 6 日
Get rid of these two useless lines of code:
clear all
clc
They serve no relevant functional purpose, and just cause you bugs (like this one). The only reason beginners put clear at the start of everything that they write is because of this:
Do not put clear at the start of everything. It does not help: it created this bug. It is not related to your code's functionality. Well written code does not need clear (or atleast very rarely): if all variables are preallcoated (as they should be) and code is written in functions (as it should be) then MATLAB's inbuilt memory manager takes quite good care of allocating and clearing variables from memory.
  6 件のコメント
Stephen23
Stephen23 2018 年 8 月 6 日
Honey Adams
Honey Adams 2018 年 8 月 6 日
Thank you for the link.So i modified it as suggested by the other contributor but it still doesnt run.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by