how to append different arrays without normalization?

1 vue (au cours des 30 derniers jours)
Anu  Sri
Anu Sri le 14 Sep 2018
Commenté : Anu Sri le 14 Sep 2018
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 commentaire
Stephen23
Stephen23 le 14 Sep 2018
Modifié(e) : Stephen23 le 14 Sep 2018
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:

Connectez-vous pour commenter.

Réponse acceptée

Stephen23
Stephen23 le 14 Sep 2018
Modifié(e) : Stephen23 le 14 Sep 2018
data = [double(i);double(j);double(blksz);double(avg)]
or using some suitable integer class which can contain the required values.

Plus de réponses (1)

Walter Roberson
Walter Roberson le 14 Sep 2018
data = [double(i); double(j); double(blksz); double(avg)];
I suspect this could be shortened to
data = [i; j; blksz; double(avg)];

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by