[TOC]

double

Converting an array to an array of double precision numbers

Usage

double(A)

Converting Characters To Doubles

πŸ’‘ Keep this in mind. When a character array A is converted using d = double(A), the sizes size(A) and size(d) may be different. This usually happens when A contains emojis or non-ASCII characters.

Examples

Input
double('abc')
Output
ans =
 97.00   98.00   99.00
Input
a = ['πŸ—»bπŸ‡¦πŸ‡²βœŠπŸΎ';
'πŸ’«bπŸ‡²πŸ‡ΆβœŠπŸΏ';
'πŸ–€fπŸ‡¦πŸ‡©βœŠπŸΏ';
'🏫dπŸ‡²πŸ‡±βœŠπŸΏ']
double(a)
Output
a = 
πŸ—»bπŸ‡¦πŸ‡²βœŠπŸΎ
πŸ’«bπŸ‡²πŸ‡ΆβœŠπŸΏ
πŸ–€fπŸ‡¦πŸ‡©βœŠπŸΏ
🏫dπŸ‡²πŸ‡±βœŠπŸΏ

ans = 
Columns 1 through 7:
 55357.   56827.   98.000   55356.   56806.   55356.   56818.
 55357.   56491.   98.000   55356.   56818.   55356.   56822.
 55357.   56740.   102.00   55356.   56806.   55356.   56809.
 55356.   57323.   100.00   55356.   56818.   55356.   56817.
Columns 8 through 10:
 9994.0   55356.   57342.
 9994.0   55356.   57343.
 9994.0   55356.   57343.
 9994.0   55356.   57343.