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

5 vues (au cours des 30 derniers jours)
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

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 27 Juin 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);

Plus de réponses (0)

Catégories

En savoir plus sur Error Detection and Correction dans Help Center et File Exchange

Tags

Produits


Version

R2009a

Community Treasure Hunt

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

Start Hunting!

Translated by