How can i decrement a value after it reached a maximum
Mostrar comentarios más antiguos
I have a 12 bit DAC And i want to send data by incrementing a variable from 0 to 4096 and after that continue to send data by decrementing from the Last point (4096) to the first one (0). My Code stops when 'i' reach the maximum (in my case the 'V' set from my keyboard)
Code:
For i=0:V
If i < V+1
Fwrite()
I=i+1
Else i > V-1
Fwrite()
I=i-1
End
End
3 comentarios
madhan ravi
el 15 de Ag. de 2018
Editada: madhan ravi
el 15 de Ag. de 2018
Can you show an example?
Voicila Iulian-Teodor
el 15 de Ag. de 2018
Voicila Iulian-Teodor
el 15 de Ag. de 2018
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Signal Attributes and Indexing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!