簡便なラッチ回路の構成
Show older comments
下記のようなコードを作りました。中身は1度でも1の入力がされると、その後は1の入力が続く仕組みとなっています。
これよりも簡便な関数もしくは、simulinkのブロック図がありましたら教えて頂けないでしょうか。
よろしくお願い致します。
clear;
aa = 0 : 0.01 : 10;
u = ones(1,numel(aa));
flg = zeros(1,numel(aa));
for x = 2 : 1 : 10002
u(x) = sin(deg2rad(x / 10));
if flg(x-1) == 1
flg(x) = 1;
else % flg == 0
if u(x) == 1
flg(x) = 1;
end
end
end
hold on
plot(flg);
plot(u);
hold off
Accepted Answer
More Answers (0)
Categories
Find more on Simulink でサポートされているハードウェア in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
