显示 更早的评论
for the given code:
primpoly = 1 0 1 1
m = 4( assumed)
indx = [0:1:2.^m-1]; %power index
for r = 1:length(indx)
U = gftuple(indx,primpoly,p)
end
I want U to be listed out in a p.^m-1 by m+1 array and not separately. so that i can access each row of U for further computation. but with the above i get U separately for each loop run and the previous U is over-written.
Also, Can i code it without using gftuple, like without any built-in function?
采纳的回答
U(r,:) = gftuple(indx,primpoly,p);
10 个评论
this generates only one U at the end several times. I want all possible U's generated by the loop to be saved up in ONE matrix/table. the o/p here is:
U =
1 0 1
1 0 1
1 0 1
1 0 1
1 0 1
1 0 1
1 0 1
1 0 1
several times! which is not the desired output.
U(r,:) = gftuple(indx(r),primpoly,p);
yes this gives the right output but several times if i do not put ';' this means U is being produced several times, cant it be reduced to just once....n Thanks!
Sorry, I do not have the Communications Toolbox to test with.
Are all of the output U's exactly the same? When there is an assignment to part of an array and you do not have a semi-colon, MATLAB outputs the entire array.
the output U is as follows:
U =
1 0 0
0 1 0
0 0 1
1 0 1
1 1 1
1 1 0
0 1 1
1 0 0
But my objective was to call this U once but here this U gets repeated 8 times (the exact same U, dont know why).
Is your code line literally
primpoly = 1 0 1 1
instead of
primpoly = [1 0 1 1]
??
I do not know why the output would be exactly the same each time when indx(r) is used, but I do see in the documentation that you do not need the loop.
U = gftuple( indx(:), primpoly, p )
Notice passing in a column of indices instead of the row you were using.
well U = gftuple( indx(:), primpoly, p ) actually works! Thanks! and yes it is supposed to be [1 0 1 1].
Is there some way to code this gf tuple function without using the built-in function?
Probably, but I have not researched to find out what the expected output would be.
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Error Detection and Correction 的更多信息
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
