How can I convert text to ASCII?

1 view (last 30 days)
Ezgi Ecevit
Ezgi Ecevit on 8 Jan 2021
Commented: Ezgi Ecevit on 8 Jan 2021
I was trying to read sensor data on my smartphone using MATLAB and I downloaded udp sensor. Using udpport and readline command I could read the data I guess but I am not sure if it is the data because I can't understand the output. So how can I convert it to something I can understand?
My code;
u2 = udpport("LocalPort",8080,"EnablePortSharing",true)
data = readline(u2)
The output;
'¼š€=€¾M‹ =Q¥ø¿,]¿==i½h¯½-ÉüBŸ­ÊÂB¥@¿®f B( @  ¼š€=€¾M‹ =PúÆ¿,š¤¿<×=i½h¯½-ÉüBŸ­ÊÂB¥@¿®f B( @  ¼š€=€¾M‹ =["п-€¿;ù{=i½h¯½-ÉüBŸ­ÊÂB¥@¿®f B( @  ¼š€=€¾M‹ =Z­¿.kj¿;y>*z=äh=<4Bœn@ÂB¥@¿®f B( @  ¼š€=€¾M‹ =V q¿.Í
¿:Éß>*z=äh=<4Bœn@ÂB¥@¿®f B( @  ¼Z†@»V  >(Á =Ll€¿.Ôh¿:Í8>*z=äh=<4B “NÂ/Õ@°Rñ B @  ¼Z†@»V  >(Á =Kkµ¿/TÍ¿:V.>*z=äh=<4B “NÂ/Õ@°Rñ B @  ¼Z†@»V  >(Á =Hôk¿/…ž¿:*·>*z=äh=<4B “NÂ/Õ@°Rñ B @  ¼Z†@»V  >(Á =P­¿0jT¿9J°>*z=äh=<4B “NÂ/Õ@°Rñ B @  ¼Z†@»V  >(Á =JëO¿0$È¿9’>>*z=äh=<4B “NÂ/Õ@°Rñ B @  ¼Z†@»V  >(Á =B\¿0c¿9­©>*z=äh=<4B “NÂ/Õ@°Rñ B @  ¼Z†@»V  >(Á =.)à¿/ëD¿9åÕ8h©¼UR~>0Á{B¡öaÂ/Õ@°Rñ B @  ¼Z†@»V  >(Á =.êy¿06Ö¿9œ8h©¼UR~>0Á{B¡öaÂ/Õ@°Rñ B @  ¼“` =)ê >\À=+‡Ë¿1iÈ¿8{a8h©¼UR~>0Á{B¤‚Â%tà@­Ç; B @  ¼“` =)ê >\À=5Ú¢¿2IÏ¿7™Y8h©¼UR~>0Á{B¤‚Â%tà@­Ç; B @  ¼“` =)ê >\À=8Ý¿7üý¿1ß{8h©¼UR~>0Á{B¤‚Â%tà@­Ç; B @  ¼“` =)ê >\À=-‰b¿<”¿-½8h©¼UR~>0Á{B¤‚Â%tà@­Ç; B @  ¼“` =)ê >\À=Bd¿¿)â8h©¼UR~>0Á{B¤‚Â%tà@­Ç; B @  ¼“` =)ê >\À=38Œ¿E6Ë¿#v?Ê_‘?„Õ½?‘÷þB¤‚Â%tà@­Ç; B @  ¼“` =)ê >\À=;>æ¿I» ¿t¦?Ê_‘?„Õ½?‘÷þB¨¢[Â%tà@­Ç; B @  ¼“` =)ê >\À<Ć?¿R}ø¿ß{?Ê_‘?„Õ½?‘÷þB¨¢[Â%tà@­Ç; B @  =÷šž>À ¾†æ;.Š-¿VöÙ¿Tø?Ê_‘?„Õ½?‘÷þB™~;ÂHÝy?˜þˆ B @  =÷šž>À ¾†æ¼Êàœ¿Yžó¿ 5?Ê_‘?„Õ½?‘÷þB™~;ÂHÝy?˜þˆ B @  =÷šž>À ¾†æ½¦Hù¿`E‹¾ô‘?Ê_‘?„Õ½?‘÷þB™~;ÂHÝy?˜þˆ B @  =÷šž>À ¾†æ½ÊÛB¿c¾÷¾åù?Ê_‘?„Õ½?‘÷þB™~;ÂHÝy?˜þˆ B @  =÷šž>À ¾†æ½÷ƒò¿f¼ª¾ÕÍB?Ê_‘?„Õ½?‘÷þB™~;ÂHÝy?˜þˆ B @  =÷šž>À ¾†æ¾'
  4 Comments
Rik
Rik on 8 Jan 2021
As I understand it, ASCII is a pretty basic encoding of text. It should already be recognizable. Or is this the 7 bit version? Then the conversion will be very tricky, but that would also have made the reading itself non-trivial.
If you find an online converter that does what you need you could post the link here and we could help you try to implement it in Matlab.
Ezgi Ecevit
Ezgi Ecevit on 8 Jan 2021
I have downloaded a sensor app which I can obtain the outputs as xml format and I can read the data now. Thank you so much for your concern...

Sign in to comment.

Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!