how to convert my matrix to a {0,1} c-dimensional unit vectors?

Hi All
I would like to know how can I convert my matrix that I have attached to a {0,1} c-dimensional unit vectors ? I don't exactly know how it should be and what's the command to do it

 채택된 답변

Greg Heath
Greg Heath 2015년 3월 16일

1 개 추천

Copy and paste into the command line
trueclassindices = [ 1 3 5 7 9 2 4 6 8 10 ]
target = ind2vec(trueclassindices)
trueclassindices = vec2ind(target)
%==== NN design using target =====
output = net(input);
assignedclasses = vec2ind(output)
error = assignedclasses~=trueclassindices
Nerr = numel(error)
PctErr = 100*Nerr/N
Hope this helps
Thank you for formally accepting my answer
Greg

댓글 수: 1

Thank you very much , Dear professor , I think now I am considering more to solve my problem via fitting feature of the NN

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2015년 3월 2일

댓글:

2015년 3월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by