Info

此问题已关闭。 请重新打开它进行编辑或回答。

What wrong with that counter ?

1 次查看(过去 30 天)
Henry Buck
Henry Buck 2015-12-9
关闭: MATLAB Answer Bot 2021-8-20
function [wr,count] = wr_blk(rst,clk,sig)
%#codegen
count = 0;
if (rst==0)
wr=0;
else
if((sig==1) && (clk==1))
count = count + 1;
else
count=0;
end
end
end
Thanks, Henry
  9 个评论
Torsten
Torsten 2015-12-9
I guess that's what my suggested solution does.
My line of code outputs the number of ones in the array clk at the positions where sig = 1.
Best wishes
Torsten.

回答(0 个)

此问题已关闭。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by