フィルターのクリア

How can I compare the results of system('getmac') to a string?

1 回表示 (過去 30 日間)
Kamuran
Kamuran 2012 年 12 月 7 日
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?

採用された回答

Image Analyst
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.
  1 件のコメント
Kamuran
Kamuran 2012 年 12 月 7 日
Thank you strcmpi works.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by