How to manipulate this matrix?

조회 수: 1 (최근 30일)
Shubham Mohan Tatpalliwar
Shubham Mohan Tatpalliwar 2018년 11월 1일
댓글: madhan ravi 2018년 11월 1일
if true
% code
A= [0,0,0;0,2,3;1,2,3]
ExpectedA=[3,2,1;3,2,0;0,0,0]

채택된 답변

madhan ravi
madhan ravi 2018년 11월 1일
편집: madhan ravi 2018년 11월 1일
A= [0,0,0;0,2,3;1,2,3]
Expected_A=[3,2,1;3,2,0;0,0,0]
result=fliplr(flip(A,1)) %here is the manipulation
logical(Expected_A==result) %to check expected result is the same as the manipulated
command window:
>> COMMUNITY
A =
0 0 0
0 2 3
1 2 3
Expected_A =
3 2 1
3 2 0
0 0 0
result =
3 2 1
3 2 0
0 0 0
ans =
3×3 logical array
1 1 1
1 1 1
1 1 1
>>
  댓글 수: 4
Shubham Mohan Tatpalliwar
Shubham Mohan Tatpalliwar 2018년 11월 1일
Actually these are the values which i want to flip but the Nan should not move from its place
madhan ravi
madhan ravi 2018년 11월 1일
get back to your old question

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by