how to define the following function
Mostra commenti meno recenti
How to define the following function in MATLAB
f(x) = 1 for 0<= x <= pi
f(x) = 1 for 0<= x <= pi
1 Commento
Walter Roberson
il 21 Gen 2013
You seem to have the same entry twice ?
Risposte (1)
Thorsten
il 21 Gen 2013
if 0 <= x && x <= pi, y = 0; end
1 Commento
Walter Roberson
il 21 Gen 2013
Or, vectorized:
y = zeros(size(x));
y(x >= 0 & x <= pi) = 1;
Categorie
Scopri di più su MATLAB 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!