Reorder confusion matrix in vectorized way

1 回表示 (過去 30 日間)
Adriano
Adriano 2011 年 10 月 24 日
回答済み: Andrei Bobrov 2017 年 6 月 13 日
Hello everyone,
I have one confusion matrix, which is a 2D cell array. The first row and the first columns are strings. The rest are numbers. Something like this:
A B C
A 100 10 15
B 20 150 25
C 10 10 200
I want to reorder the matrix, something like this:
C A B
C 200 10 10
A 15 100 10
B 25 20 150
I know I could do this the hard way, but which could be a nice, vectorized way to do it? I still don't quite handle very good vectorized code.
Thanks
  1 件のコメント
Agneev Guin
Agneev Guin 2017 年 6 月 13 日
Does anyone have any solution to this. Thanks.

サインインしてコメントする。

回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2017 年 6 月 13 日
circshift(A,[1 1])

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by