How can i change strings into numbers


(ahmed_seh) #1

hello guys sorry 4 bothering u with me. i know that im asking much help from u but i know also u will not let me down. im counting on u guys

i have message like hi there how r u

how can i change that message to number??

im designing RSA algorithm so converting part is very important to me

i tried functions str2num and double but i didnt get any satisfied answer.

my second question is if i have the following arithmetic operation

d= 79^-1 mod 3220
how can i write into matlab code i tried it as above but i got message said

error, missing operatot, comma or semicolon

how can i do it?

also i tried the command d=mod(79^-1,3220)
but the result wasnt correct as it should be. the answer is 1019 but i got 0.0127

u see the big difference between two previous answer.

hopefully u will help me


(عبد العزيز غالب) #2

[CENTER]it can be done
try this


a=' how are man'
b=char(a)
c=double(b) [/center]
 
[CENTER]c is the repesentation in ASCI code for the string[/center]
 
[CENTER]you can get it back [/center]
 
[CENTER]x= char(c)[/center]
 
[CENTER]

[/center]


just try it