controlling array data when calculating
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
im try to avoiding having a w = 0. how do i code this?
a = 10;
w = -a:(a/1000):a
F = 2*sin(a*w)./w;
0 commentaires
Réponse acceptée
Image Analyst
le 8 Sep 2013
Another way is to just delete the element where w=0:
w(w==0) = [];
0 commentaires
Plus de réponses (2)
Azzi Abdelmalek
le 8 Sep 2013
Modifié(e) : Azzi Abdelmalek
le 8 Sep 2013
a = 10;
w = -a:a/1000:a;
F = 2*sin(a*w)./w;
tol=0.01
idx=find(abs(F)<tol)
[w(idx)' F(idx)']
0 commentaires
Voir également
Catégories
En savoir plus sur Resizing and Reshaping Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!