how to append different arrays without normalization?

조회 수: 1 (최근 30일)
Anu  Sri
Anu Sri 2018년 9월 14일
댓글: Anu Sri 2018년 9월 14일
i have four arrays of different values and i have to append the arrays one after other vertically in a single array. i have tried this code
data=[i;j;blksz;avg]
but the problem i am facing is that values above 255 in array i and j are automatically normalized to 255. can anyone let me know how to fix it???
  댓글 수: 1
Stephen23
Stephen23 2018년 9월 14일
편집: Stephen23 2018년 9월 14일
The values are being converted to the class of the first array, which appears to be uint8. How these conversions work is explained in the MATLAB documentation:

댓글을 달려면 로그인하십시오.

채택된 답변

Stephen23
Stephen23 2018년 9월 14일
편집: Stephen23 2018년 9월 14일
data = [double(i);double(j);double(blksz);double(avg)]
or using some suitable integer class which can contain the required values.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2018년 9월 14일
data = [double(i); double(j); double(blksz); double(avg)];
I suspect this could be shortened to
data = [i; j; blksz; double(avg)];

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by