How to realize this cycle in MatLab?
Mostra commenti meno recenti
int i;
int y1;
int y2;
int y3;
int y4;
int y5;
int y6;
int y7;
for (i=0; i<100; i++){
if(x[i]>=m && x[i]<m+s)
y1++;
else if (x[i]>=m+s && x[i]<m+2*s)
y2++;
else if (x[i]>=m+2*s && x[i]<m+3*s)
y3++;
else if (x[i]>=m+3*s && x[i]<m+4*s)
y4++;
else if (x[i]>=m+4*s && x[i]<m+5*s)
y5++;
else if (x[i]>=m+5*s && x[i]<m+6*s)
y6++;
else if (x[i]>=m+6*s && x[i]<=m+7*s)
x is a 1x100 array
m is a minimum value of an array
s is a step (constant value)
Can You help to rewrite this cycle using Matlab?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Mathematics and Optimization in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!