Clear Filters
Clear Filters

Info

This question is closed. Reopen it to edit or answer.

What wrong with that counter ?

1 view (last 30 days)
Henry Buck
Henry Buck on 9 Dec 2015
Closed: MATLAB Answer Bot on 20 Aug 2021
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 Comments
Torsten
Torsten on 9 Dec 2015
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.

Answers (0)

This question is closed.

Tags

Community Treasure Hunt

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

Start Hunting!