Load F2m polynomial from binary string

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Load F2m polynomial from binary string

Jeffrey Walton
Hi Everyone,

I am having trouble loading F2m polynomial from a string.

I believe the manual pages are at [1] and [2] but I don't see a
discussion of how to load a F2m polynomial from a string.

How do I load the F2m polynomial from a string?

Thanks in advance.

=====

>> r = gf([100000000000000000000000000000000000000000000000000000000000001
1]);
>> r = gf([100000000000000000000000000000000000000000000000000000000000001
1]);
error: gf: data outside range of Galois Field GF(2^1)
error: gf: data outside range of Galois Field GF(2^1)
>> r = gf([ "1000000000000000000000000000000000000000000000000000000000000
011" ]);
error: invalid conversion from string to real matrix
>> r = gf("100000000000000000000000000000000000000000000000000000000000001
1");
error: invalid conversion from string to real matrix
>> r = gf(['10000000000000000000000000000000000000000000000000000000000000
11']);
error: invalid conversion from string to real matrix
>> r = gf('100000000000000000000000000000000000000000000000000000000000001
1');
error: invalid conversion from string to real matrix

=====

I'm aware this works, but the strings I have are not in this format:

>> a = gf( [1 0 1 0 1 0 0 1 1 0 1 0 1 0 0 1 1 0 1 0 1 0 0 1 1 0 1 0 1 0 0
1 1 0 1 0 1 0 0 1 1 0 1 0 1 0 0 1 1 0 1 0 1 0 0 1 1 0 1 0] );

=====

[1] https://octave.org/doc/v4.0.3/Terminal-Input.html#Terminal-Input
[2] https://octave.org/doc/v4.0.3/Miscellaneous-Functions.html#Miscellaneous-Functions