Azzera filtri
Azzera filtri

Values from workspace change

1 visualizzazione (ultimi 30 giorni)
Joel Schelander
Joel Schelander il 25 Feb 2021
Risposto: Steven Lord il 25 Feb 2021
I have a vector with values:
DH=[0 0 0 0 0 0 3.95 1009.15 0]
I insert the DH in a matrix
TimeofHomeArrival=[Home; DateVector(:,4).'; DateVector(:,5).'; DateVector(:,6).'; DH];
The values in the matrix are however now different than from the workspace
TimeofHomeArrival(5,:)=[ 0 0 0 0 0 0 4 127 0]

Risposta accettata

Steven Lord
Steven Lord il 25 Feb 2021
Home is an int8 array. When you combined the int8 data with the double data, the double data was converted to int8. See this documentation page and the "Largest and Smallest Values for Integer Classes" section on this documentation page for more information.
If you want to make TimeOfHomeArrival a double array you'll need to convert the int8 data into double by calling double on it.

Più risposte (0)

Categorie

Scopri di più su Matrices and Arrays in Help Center e File Exchange

Prodotti


Release

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by