Thanks for your response. symbol_book is 1x4 matrix which has the QPSK reference quadrants {0.7071+0.7071i, -0.7071+0.7071i, -0.7071-0.7071i, 0.7071-0.7071i}. Now, the x_hat is the estimated data with 50000x1 matrix. What i am trying to do is find the min distance between the QPSK reference and the actual received data. Not sure if maybe when i switched to 2015 matlab would have an effect! please advise
I get an error in knnsearch
조회 수: 3 (최근 30일)
이전 댓글 표시
rec_syms = knnsearch([real(symbol_book) imag(symbol_book)], [real(X_hat) imag(X_hat)]) - 1;
I get this error:
Error using KDTreeSearcher/knnsearch (line 74)
Y must be a matrix with 8 columns.
Error in knnsearch (line 142)
idx = knnsearch(O,Y,'k',numNN, 'includeties', includeTies);
Error in OFDM_image (line 139)
rec_syms = knnsearch([real(symbol_book) imag(symbol_book)], [real(X_hat) imag(X_hat)]) - 1;
채택된 답변
Walter Roberson
2015년 12월 5일
[real(symbol_book) imag(symbol_book)] together makes a matrix with 8 columns, such as if there are 4 columns in symbol_book. But [real(X_hat) imag(X_hat)], the locations to search for, does not have 8 columns. The locations to search for (the second parameter) must have the same number of columns as the first parameter.
댓글 수: 3
Walter Roberson
2015년 12월 6일
You had a row vector of 4 elements. real() of that is something that is 1 x 4. imag() of it was also 1 x 4. []'ing those together resulted in something 1 x 8. Your set of points to be searched through was therefore a single point with 8 dimensions. But that is not what you wanted: you wanted 4 points with two dimensions. Using symbol_book(:) reshapes from 1 x 4 to be 4 x 1. Use [] to put two 4 x 1 together and you get 4 x 2 -- 4 points each with 2 dimensions.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Classification Ensembles에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!