フィルターのクリア

substitute for discretize command

7 ビュー (過去 30 日間)
pavan sunder
pavan sunder 2016 年 11 月 18 日
コメント済み: johnson saldanha 2018 年 11 月 6 日
discretize function was available in new version of matlab..but i have older version (R2014b)in my desktop. i cannot install new version into my desktop..please help my with an alternative function for discretize in matlab

回答 (1 件)

Walter Roberson
Walter Roberson 2016 年 11 月 18 日
For equal intervals, separated by delta:
discrete_x = floor( (x - minimum_allowed_x) ./ delta ) .* delta + minimum_allowed_x;
For unequal intervals in which the left edges are given by the vector edges and the last entry of edges is the upper bound:
[~, ~, bin] = histcounts( x, edges );
discrete_x = edges(bin);
  5 件のコメント
Walter Roberson
Walter Roberson 2016 年 12 月 20 日
[~, discrete_x] = histc(x, edges);
discrete_x(discrete_x == length(edges)) = length(edges)-1;
discrete_x(discrete_x == 0) = NaN;
johnson saldanha
johnson saldanha 2018 年 11 月 6 日
may i know how can i be able to get the 2nd column from the x matrix in discrete_x

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by