Why do quotes in norm for infinity norm sometimes work
조회 수: 4 (최근 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에서 Introduction to Installation and Licensing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!