- character vs. numeric msg.
- vector vs. matrix msg.
msg=dec2bin(32,8); encode_data=encode(msg,14,8,'cyclic');but it appears an error like "Output argument "code" (and maybe others) not assigned during call to "encode". Error in cyclic_code_check (line 12) encode_data = encode(msg,n,k,'cyclic')"
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
lingamallu srinivas
le 2 Nov 2018
Modifié(e) : Stephen23
le 2 Nov 2018
I have an error using this commands
msg=dec2bin(32,8);
encode_data=encode(msg,14,8,'cyclic');
ERROR IS
Output argument "code" (and maybe others) not assigned during call to "encode".
Error in cyclic_code_check (line 12) encode_data = encode(msg,14,8,'cyclic')
but we don't have an error using this code
msg=[0 0 1 0 0 0 0 0];
encode_data=encode(msg,14,8,'cyclic');
please give solution to the above error as early as possible
0 commentaires
Réponse acceptée
Stephen23
le 2 Nov 2018
Modifié(e) : Stephen23
le 2 Nov 2018
There are some differences between your two function calls:
Apparently encode does not work for a character matrix msg. Either it needs to be a numeric matrix or a vector, or a numeric vector. You can try those yourself, e.g.:
msg = dec2bin(32,8)-'0'; % convert character to numeric matrix
If I assume that you are using the Communication Toolbox encode function, then its help clearly states that it only accepts binary or decimal inputs for msg, so a character matrix is not permitted.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Resizing and Reshaping Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!