How to manipulate this matrix?

1 Ansicht (letzte 30 Tage)
Shubham Mohan Tatpalliwar
Shubham Mohan Tatpalliwar am 1 Nov. 2018
Kommentiert: madhan ravi am 1 Nov. 2018
if true
% code
A= [0,0,0;0,2,3;1,2,3]
ExpectedA=[3,2,1;3,2,0;0,0,0]

Akzeptierte Antwort

madhan ravi
madhan ravi am 1 Nov. 2018
Bearbeitet: madhan ravi am 1 Nov. 2018
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 Kommentare
Shubham Mohan Tatpalliwar
Shubham Mohan Tatpalliwar am 1 Nov. 2018
Actually these are the values which i want to flip but the Nan should not move from its place
madhan ravi
madhan ravi am 1 Nov. 2018
get back to your old question

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by