Why do quotes in norm for infinity norm sometimes work
2 次查看(过去 30 天)
显示 更早的评论
I'm just curious as to why, for some matrix A, you can calculate the infinity norm with
- norm(A, inf)
- norm(A, Inf)
- norm(A, 'inf')but not
- norm(A, 'Inf')
especially when
>> inf
ans =
Inf
Seems strange to have included 'inf' -- and the command itself doesn't indicate that 'inf' is a valid input either:
>> norm(A, 'Inf')
Error using norm
The only matrix norms available are 1, 2, inf, and 'fro'.
0 个评论
采纳的回答
dpb
2013-12-9
"Because" :)
It appears the author of norm did go as far as to do a string comparison of the inputs but didn't bother to [upper/lower]case the input string before making the comparison internally.
The same case-sensitive comparison fails in the same fashion with 'Fro' as opposed to 'fro'
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!