How do I save a Galois Field array to a file in MATLAB 7.8( R2009a)
조회 수: 5 (최근 30일)
이전 댓글 표시
I have created a Galois Field array using the GF command in Communication Toolbox 4.3 (R2009a). I want to write this array to a file using FWRITE. When I try to write it using the following MATLAB code:
x = 0:3;
m = 2;
a = gf(x,m);
fid=fopen('output1.txt','w');
fwrite(fid,a,'ubit1');
fclose(fid);
I get an error message:
??? Error using ==> fwrite
Cannot write value: unsupported class gf
채택된 답변
MathWorks Support Team
2009년 6월 27일
The ability to directly write a Galois Field array to a file is not supported in MATLAB 4.3 (R2009a).
In order to write a galois field array, one needs to convert the GF object to a double and then write to a file. For instance:
x = 0:3;
m = 2;
a = gf(x,m);
a_new =double(a.x);
fid=fopen('output1.txt','w');
fwrite(fid,a_new,'ubit1');
fclose(fid);
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 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!