Function file does not work

9 ビュー (過去 30 日間)
Nehad
Nehad 2024 年 9 月 10 日
コメント済み: Jatin 2024 年 9 月 15 日
If I save a function in a file it is not work even I save the function file in the same folder of the code
the error is
'Undefined function 'Crouts1A' for input arguments of type 'double'.'
but if I write the function in the last code it is work.. how can I fix it.
My version Matlab is R2024a
  4 件のコメント
Nehad
Nehad 2024 年 9 月 10 日
here is the code
Stephen23
Stephen23 2024 年 9 月 10 日
編集済み: Stephen23 2024 年 9 月 10 日
@Nehad: do you see how the function name is underlined with a wavy orange line? Do not ignore these mlint warnings: right-click on the warning and see what the message tells you. Most likely that will help you solve your problem.
If you want us to help you then please upload your file here by clicking the paperclip button. We cannot run a screenshot.

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

採用された回答

Jatin
Jatin 2024 年 9 月 10 日
編集済み: Jatin 2024 年 9 月 10 日
Hi @Nehad,
The error message you are encountering typically happens when MATLAB can't find the function you're trying to call. Here are few reasons this could happen:
1. Ensure that the function is saved in a file with the exact same name as the function. MATLAB requires that the filename match the function name exactly, including case sensitivity.
For Example: If the function name is "LUCrouts1A" then file name should be "LUCrouts1A.m".
2. Check that the folder containing the function is in the current working directory or is added to the MATLAB path if not.
Please let me know if this resolves the issue.
  2 件のコメント
Nehad
Nehad 2024 年 9 月 15 日
How can I added to Matla path?
Jatin
Jatin 2024 年 9 月 15 日
You can use the addpath function to add any folder to MATLAB search path, and then use savepath to make the changes permanent.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSearch Path についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by