How do I save a Galois Field array to a file in MATLAB 7.8( R2009a)

1 view (last 30 days)
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

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
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);

More Answers (0)

Tags

Products


Release

R2009a

Community Treasure Hunt

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

Start Hunting!