필터 지우기
필터 지우기

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 CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by