What does Out of range or non-integer values truncated during conversion to character mean and how to solve it?

1 回表示 (過去 30 日間)
Warning: Out of range or non-integer values truncated during conversion to character.
> In cell.strcat at 55
In Testing_Automator_v4 at 27
Line 27-29:
[~,id_raw2] = unique(strcat(raw2(:,1), 'rows'));
get_motors_no_workbook2 = raw2(id_raw2,:);
get_motors_no_workbook2 = get_motors_no_workbook2(2:end,1);

回答 (1 件)

Guillaume
Guillaume 2016 年 4 月 25 日
Your raw2 cell array contains numerical values in column 1. strcat interpret these values as character codes (e.g. it translates 65 into A) and is warning you that some of them are not valid character codes (because they're not integers or not in the valid range of integers).
Most likely, you didn't want to perform strcat on that column of the cell array. What are you trying to do?
Also suspicious is your passing of the 'rows' to strcat, wasn't this meant as a second argument to unique instead?
That is did you mean?
[~, id_raw2] = unique(raw2(:, 1), 'rows');
  1 件のコメント
Leonardo Wayne
Leonardo Wayne 2016 年 4 月 25 日
[~, id_raw2] = unique(raw2(:, 1), 'rows');
This command doesn't does not work it must be a string(char). See attached for raw2 and 3rd command above. It does the job right as you can see duplication is removed but I don't understand the warning mentioned above.

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

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by