필터 지우기
필터 지우기

for loop for binary values from 00000 to 11111

조회 수: 10 (최근 30일)
MANJUNATH
MANJUNATH 2012년 10월 11일
i want to enable rows of a pixel by giving logic high to them , I want write a FOR loop so that first 000000 then 10000 then 01000 then 11000.......11111 are given as input plz guide me with this
note: MSB and LSB are interchanged

채택된 답변

Andreas Goser
Andreas Goser 2012년 10월 11일
Why a loop? Try
A=1:16
dec2bin(A)
And then flip the order.
  댓글 수: 2
MANJUNATH
MANJUNATH 2012년 10월 11일
Thank u Sir ,
one more basic doubt - (A) gets each binary value according right ?
if so is there any way i can set time for each A's value
for example , A= 00000 FOR 10 milisec then 00001 for 10 milisec then 00010
is it possible ???
Walter Roberson
Walter Roberson 2012년 10월 11일
Only if you can find a way to pause() for 10 millisecond, but that is a much finer time resolution than pause() supports.
Please think more about whether you want the signal itself) to be a particular value for 10 millisecond at a time, or if you want a signal to be _represented as-if it was a value for 10 millisecond. If you are doing real-time work such as controlling a motor, then you would like the signal itself to have the value for real seconds, but if you are trying to produce a graph of a communications system, then you want the representation of 10 milliseconds.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Andrei Bobrov
Andrei Bobrov 2012년 10월 11일
out = rem(floor((0:63)'*pow2(-5:0)),2)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by