how to call prepared function (m file)
現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
古いコメントを表示
Hi,
I downloaded a function a function and I want to use it in my script. I tried to call it by using 'load' and 'import' but got error.
how can I call it?
採用された回答
Sriram Tadavarty
2020 年 3 月 16 日
Hi Sani,
You can directly call the function with its name, provided it is in the path. For example your downloaded function name is myfun.m, then directly call with its name and required inputs in the script you want to access.
Regards,
Sriram
8 件のコメント
sani
2020 年 3 月 16 日
It says Undefined variable when I do that
Sriram Tadavarty
2020 年 3 月 16 日
Is that ensured the file is in the matlab path? Does the function have any inputs and outputs? Can you show what the error is?
sani
2020 年 3 月 16 日
I downloaded the function from here: https://www.mathworks.com/help/matlab/ref/scatter.html
the error messege is:
scatter_kde.m
Undefined variable "scatter_kde" or class "scatter_kde.m".
Sriram Tadavarty
2020 年 3 月 16 日
Hi Sani, i didn't see any function with name scatter_kde.m, in that page.
sani
2020 年 3 月 16 日
sorry wrong URL, this it the one: https://www.mathworks.com/matlabcentral/fileexchange/65728-scatter-plot-colored-by-kernel-density-estimate
Sriram Tadavarty
2020 年 3 月 16 日
Thanks for the link. May i know if the example provided in the function, works? Like, try help scatter_kde in command promt and run the example.
sani
2020 年 3 月 16 日
yes it works
Sriram Tadavarty
2020 年 3 月 16 日
Then, it should work if used in script directly. Use it with scatter_kde(x,y) in the script
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Downloads についてさらに検索
参考
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)
