Values from workspace change

조회 수: 1 (최근 30일)
Joel Schelander
Joel Schelander 2021년 2월 25일
답변: Steven Lord 2021년 2월 25일
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]

채택된 답변

Steven Lord
Steven Lord 2021년 2월 25일
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.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by