How to manipulate this matrix?
1 回表示 (過去 30 日間)
古いコメントを表示
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]
0 件のコメント
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!