フィルターのクリア

How to find floor value of a cell??? please help....

2 ビュー (過去 30 日間)
Sreeda M A
Sreeda M A 2016 年 7 月 13 日
回答済み: Image Analyst 2016 年 7 月 13 日
How can i find floor of a cell i.e.to get only decimal values in a cell???

回答 (3 件)

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 7 月 13 日
編集済み: Azzi Abdelmalek 2016 年 7 月 13 日
your_cell_array={1.23 2.58 3 7.02 -4.6 -4.2}
your_cell_array=cellfun(@floor,your_cell_array,'un',0)

Thorsten
Thorsten 2016 年 7 月 13 日
編集済み: Thorsten 2016 年 7 月 13 日
floor(cell2mat(C))

Image Analyst
Image Analyst 2016 年 7 月 13 日
To get only the decimal (fractional) values, subtract off the integer part.
% Define sample data in cells of a cell array:
m = {1.23 2.58 3 7.02 -4.6 -4.2}
% Convert cell array to array of doubles:
dbl_m = cell2mat(m);
% Get only the decimal, fractional part by subtracting the integer part:
dbl_m = dbl_m - fix(dbl_m)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by