Getting error when asking from max and min for negative values.
显示 更早的评论
I have two vector of negative numbers (log values). The first is fine as it has a postive max value and a negative min. But i get an error for the second vector (which has its max and min as negative numbers) when i ask for max or min. What is another option to get these two values??
error: Subscript indices must either be real positive integers or logicals.
2 个评论
Rik
2017-12-27
What code are you using? Are you using the min and max functions? The error sounds like you aren't.
Yasmin Samy
2017-12-27
编辑:Walter Roberson
2017-12-27
采纳的回答
更多回答(1 个)
Walter Roberson
2017-12-27
0 个投票
Do not name a variable min or max. Also do not name a variable sum . Using any of these variable names is quite likely to run into problems when you later try to use the same name as if it were the MATLAB function.
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!