フィルターのクリア

Viterbi algorith for trellis traceback

3 ビュー (過去 30 日間)
Mohamad Khalil
Mohamad Khalil 2021 年 1 月 17 日
コメント済み: Mohamad Khalil 2021 年 1 月 22 日
Hello,
i am trying to simulate GSM and i have s function called FCN_VITERBI that generate table for trellis, metrics and metric differences and then trys to find the last state and traceback the trellis based on viterbi algorithm.
At the end i am trying to show the trellis by using the following function:
function [C] = showTrellis(S,bEst,sTrace)
len = 10;
figure(30)
clf
C = [0 1 0; 0 1 0; 0 1 0; 0 1 0;1 0 0; 1 0 0; 1 0 0; 1 0 0];
%plot([1,2],[(1:8)',S(:,1)]','-o');
hold on
for i = 0:len - 2
P = plot([2,1]+i,[(0:7)',S(:,2+i)-1]','-o','Linewidth',3); %the error position
%plot([2,1]+i,[(0:7)',S(:,2+i)-1]','-o','Linewidth',3);
for j = 1:8
P(j).Color = C(j,:);
end
text(i + 1.4,-.5,num2str(bEst(i+1)),'FontSize',14);
end
plot(sTrace(1:len)-1,'--k','Linewidth',3);
title('Trellis Diagram');
end
but i get the following error:
Error using horzcat
Dimensions of arrays being concatenated are not consistent.
Error in showTrellis (line 10)
P = plot([2,1]+i,[(0:7)',S(:,2+i)-1]','-o','Linewidth',3);
%some infos
length(S) = 62
length(h) = 6
length(y) = 66
L = 5
length( r ) = 64
length(ini_S) = 1
tail_R = [111]
can someone please help?
Thanks

回答 (1 件)

Gaurav Garg
Gaurav Garg 2021 年 1 月 20 日
Hi Mohamad,
You should try printing individual arrays [2,1]+i and [(0:7)',S(:,2+i)-1]' and ensure that the array sizes are same.
  1 件のコメント
Mohamad Khalil
Mohamad Khalil 2021 年 1 月 22 日
They are not, thank you so much

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

カテゴリ

Help Center および File ExchangeError Detection and Correction についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by