I want to convert a single cell to a float number
21 ビュー (過去 30 日間)
古いコメントを表示
i have a cell
celltest = {23.234,123.45};
And I want to convert the first number to float
something like this:
cell2float(celltest(1))
0 件のコメント
回答 (3 件)
David Hill
2022 年 4 月 3 日
Should already be a float double. If not then,
double(celltest{1})
0 件のコメント
the cyclist
2022 年 4 月 3 日
I'm confused. The way you have defined celltest, the first element is already a (double-precision) floating-point number:
celltest = {23.234,123.45};
class(celltest{1})
KSSV
2022 年 4 月 3 日
celltest = {23.234,123.45};
class(celltest{1})
If it is double, nothing need to be done. If it is a string, read about str2num, str2double.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!