How can I compare the results of system('getmac') to a string?
조회 수: 1 (최근 30일)
이전 댓글 표시
I am trying to protect my code by comparing the mac address of the computer.
I can get the mac address:
[E R]=system('getmac');
mac_add=R(160:178)
but I do not know how to convert that to a string so that I can use strcmp. Any ideas?
댓글 수: 0
채택된 답변
Image Analyst
2012년 12월 7일
mac_add is a string. Maybe it just didn't work with strcmp() because you have a trailing space. Try mac_add=R(160:177) instead. Or maybe you need to use strcmpi() instead.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!