필터 지우기
필터 지우기

how can I set double-value array input in a function?

조회 수: 5 (최근 30일)
jimaras
jimaras 2014년 2월 2일
댓글: Walter Roberson 2014년 2월 3일
Hello,
I want to create a function with inputs 2 arrays (with double values) and one value and i get the following message:
'Undefined function 'HighestPrice' for input arguments of type 'double'.
Any ideas?
Thank you.

채택된 답변

Wayne King
Wayne King 2014년 2월 2일
편집: Wayne King 2014년 2월 2일
This error message indicates that you have the function HighestPrice.m in a folder that is not on the MATLAB path.
Let's say you have this file in c:\mfiles. You have to add this folder to the MATLAB path.
Either
>>addpath 'c:\mfiles'
or use
>>pathtool
and add the folder.
If you have done it correctly, you can enter
>>which HighestPrice
and MATLAB will return the path to the .m file.
  댓글 수: 3
Wayne King
Wayne King 2014년 2월 3일
편집: Wayne King 2014년 2월 3일
Then that folder is not on the path, or you do not have the function in the folder. One or both of those is true.
Enter
>>path
and look for that folder. Then go to the folder and make sure you have saved the function where you think you have.
Walter Roberson
Walter Roberson 2014년 2월 3일
Or the file is misnamed. It should be HighestPrice.m as noted above.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Search Path에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by