필터 지우기
필터 지우기

One integer array out of many double ones?!

조회 수: 2 (최근 30일)
Fatma Abdullah
Fatma Abdullah 2018년 12월 29일
답변: Image Analyst 2018년 12월 29일
if i have 4 arrays A,B,C,D:
how to assign only one array A to be integer?
if i typed A=int8(A); i get all 4 arrays to be integers not just A.
  댓글 수: 3
Fatma Abdullah
Fatma Abdullah 2018년 12월 29일
편집: Fatma Abdullah 2018년 12월 29일
No all four were float , when i write that line only for A,, they all get affected.
Rik
Rik 2018년 12월 29일
Please do not just close the question if it has any answers without responding to them.
It is impossible for any variable other than A to be affected by the line A=int8(A), unless you have shadowed the int8 function with something that uses evalin or any equivalent horrible code.

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

채택된 답변

Image Analyst
Image Analyst 2018년 12월 29일
Not true. Here's proof
A = rand(1,2)
B = rand(1,3)
C = rand(1,4)
D = rand(1,5)
A = int8(A)
whos('A', 'B', 'C', 'D')
You can see that the whos function shows that only A was converted to int8, and the rest remained as double
Name Size Bytes Class Attributes
A 1x2 2 int8
B 1x3 24 double
C 1x4 32 double
D 1x5 40 double

추가 답변 (0개)

카테고리

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