matchpairs function input parameter costUnmatched
5 次查看(过去 30 天)
显示 更早的评论
How to choose proper value of parameter costUnmatched (matchpairs function) to get requested number of matches.
Especially in a case, when I need maximum number of possible matches min(M,N), where [M,N] = size(Cost), Cost is (M x N) matrix.
Is there at least some clue for a suitable choice of costUnmatched for given cost matrix?
10 个评论
采纳的回答
Michal
2020-2-14
编辑:Michal
2020-2-14
5 个评论
Steven Lord
2020-2-14
If I'm right about what's going on in this situation, should the second line in the following example warn as well? After all, users might think that "something is wrong" when y turns out to be equal to x.
x = 1e20;
y = x + 1;
If this should issue a warning, every single call to plus would need to check if it needs to issue a warning. How much of a slowdown would you be okay with imposing on every user of the plus function or + operator for that check? It might only be a tiny slowdown, but how many times does the MATLAB code you run use the plus function or + operator? A tiny slowdown occurring thousands or millions of times over the course of running your program can add up to a substantial delay.
>> minutes(1e6*seconds(0.001))
ans =
16.6667
Lest you think this is a hypothetical concern ... there used to be a function called intwarning. [It started issuing a warning about its removal in release R2010a and started throwing an error in release R2010b.] Looking at its documentation from one of the releases where it existed (I chose release R2009b):
"Caution Enabling the MATLAB:intMathOverflow warning slows down integer arithmetic. It is recommended that you enable this particular warning only when you need to diagnose unusual behavior in your code, and disable it during normal program operation. The other integer warnings listed here do not affect program performance."
Warning can impact performance.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!