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 日

0 投票

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 件のコメント

jimaras
jimaras 2014 年 2 月 2 日
I have in my working folder. I checked it. However, while using the 'which HighestPrice' I get a message that the function was not found.
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 件)

カテゴリ

ヘルプ センター および File Exchange で Programming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by