필터 지우기
필터 지우기

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 CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by