How can I convert text to ASCII?
Show older comments
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=<4Bn@ÂB¥@¿®f B( @ ¼=¾M =V q¿.Í
¿:Éß>*z=äh=<4Bn@Â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Ö¿98h©¼UR~>0Á{B¡öaÂ/Õ@°Rñ B @ ¼` =)ê >\À=+Ë¿1iÈ¿8{a8h©¼UR~>0Á{B¤Â%tà@Ç; B @ ¼` =)ê >\À=5Ú¢¿2IÏ¿7Y8h©¼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
on 8 Jan 2021
Are you sure the data sent over this connection is actually text?
Ezgi Ecevit
on 8 Jan 2021
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
on 8 Jan 2021
Answers (0)
Categories
Find more on Downloads in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!