フィルターのクリア

Why my code is not working in simulink while its ok in matlab?

1 回表示 (過去 30 日間)
c.m.f.s.
c.m.f.s. 2015 年 10 月 8 日
編集済み: Walter Roberson 2015 年 10 月 8 日
I have following code
input = [1,0,1,0,0,1,1,1,1,1,0,1,0,1,0,1,0,1,1,1,1,1,1,0,1,0,1,0,1,1,1,1,1,1,0];
[m,n] = size(input);
i = 1;
startSig = [1,0,1];
allSwitch = zeros(3,n);
while i <= n-2
if isequal(input(1,i:i+2),startSig)
outputSwitch = bi2de(input(1,i+4:i+5));
j=i+6;
% cond = 0;
k = 1;
output = zeros(1,n);
while j <= n && input(j) ~= 0
output(j) = input(1,j);
k = k+1;
j = j+1;
end
allSwitch(outputSwitch,:)=output;
i = j+1;
else
i = i+1;
end
end
Switch1 = allSwitch(1,:)
Switch2 = allSwitch(2,:)
Switch3 = allSwitch(3,:)
But when I use this code deleting the input values in simulink matlab use defined function block I did not get any out. I use here same input sequence used in matlab as square pulse.

回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by