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

1 次查看(过去 30 天)
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 中查找有关 Startup and Shutdown 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by