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
Sriram Tadavarty 2020년 3월 16일

0 개 추천

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
sani 2020년 3월 16일
It says Undefined variable when I do that
Sriram Tadavarty
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
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
Sriram Tadavarty 2020년 3월 16일
Hi Sani, i didn't see any function with name scatter_kde.m, in that page.
Sriram Tadavarty
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
sani 2020년 3월 16일
yes it works
Sriram Tadavarty
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에 대해 자세히 알아보기

질문:

2020년 3월 16일

댓글:

2020년 3월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by