Effacer les filtres
Effacer les filtres

using the following "function output = conv_enco(input, K, g)" i have to call "function [next_state, output] = conv_enc(crt_state, input, K, g)" how can it be done in a matlab code? Kindly let me know.

1 vue (au cours des 30 derniers jours)
How can call the above first function1 using function2 in a matlab code?

Réponse acceptée

Walter Roberson
Walter Roberson le 8 Sep 2015
function output = conv_enco(input, K, g)
crt_state = randi(1234);
[next_state, output] = conv_enc(crt_state, input, K, g);
end
It is advised that you do not name a variable "input" as doing that interferes with the MATLAB input() routine.
  4 commentaires
s
s le 8 Sep 2015
i am new to matlab and calling functions in matlab.
Walter Roberson
Walter Roberson le 8 Sep 2015
If you want conv_enco to be called by conv_enc then you can code
function [next_state, output] = conv_enc(crt_state, input_sequence, K, g);
fprintf('ignoring unneeded crt_state that was:\n');
disp(crt_state);
output = conv_enco(input_sequence, K, g);
next_state = 7; %lucky 7
end

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Programming 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!

Translated by