Function for angle to output 1 or 0
Mostra commenti meno recenti
I'm trying to write a funciton that has two outputs, 1 or 0. Based on the angle if its between 0 and 34 degrees its = 0. Then if it's between 34 and 68 = 1. That repeats itself 360 degrees. If anyone can help with the code for the fucntion it would be great! Currently I had:
function Thet = Theta (A)
returnValue = 1;
if mod(A, 68)~= 0
returnValue = 0;
end
Thet = returnValue;
end
1 Commento
Rena Berman
il 22 Lug 2020
(Answers Dev) Restored edit
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Powertrain Blockset in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!