What is a double matrix?
显示 更早的评论
I have data that I need to convert into a double matrix. How do I do that ?
5 个评论
Awais Saeed
2021-12-11
编辑:Awais Saeed
2021-12-11
What is your data, its dimensions and data type?
Zach Hanses
2021-12-11
KSSV
2021-12-11
You may proceed with the existing sinlge, Why you want to convert it to double ?
Zach Hanses
2021-12-11
Awais Saeed
2021-12-11
Decimal point data (aka floating pointer numbers) can be represented as either single precision numbers or double precesion numbers. Single precision data takes 32bits in memory while double precision data takes 64bits. The greater the number of bits, the higher the accuracy. But you can easy tell that double precision costs you more memory. Read more here.
回答(3 个)
KSSV
2021-12-11
0 个投票
If it is a string, read about str2num, str2double.
If it is a single, use double.
If it is a sym class, use double.
3 个评论
Zach Hanses
2021-12-11
Zach Hanses
2021-12-11
In MATLAB every variable has a class. You can get the class using the function class......the numbers i.e. floatingpoint numbers can be single or double. If your precipitation is a single, and you want it to double, yes use:
double(precipitaiton)
A = magic(4) % data type is double
s = single(A) % convert double to single
d = double(s) % convert single to double
whos
retime() works fine with single precision.
dates = datetime('2000-01-01') + calmonths(0:3:35).'
data = randn(size(dates), 'single')
TT = timetable(dates, data)
TT5 = retime(TT, 'yearly', 'mean')
类别
在 帮助中心 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!