For Loop using values from x axis

My x axis has values ranging from -400 to 400
i want to create a for loop which tests whether each xvalue is bigger or smaller than positive/negative 24.
is there a way, perhaps an array?, with which i can do it

1 Commento

For x=-400:400 if (×》24) % 》=greater than Disp(x) End End

Accedi per commentare.

Risposte (1)

Takumi
Takumi il 4 Giu 2020
Modificato: Takumi il 4 Giu 2020
For example, you can check whether x is greater than 24 without using for loops.
x=-400:400;
x(x>=24)
When using a for loop
x=-400:400;
for i=1:length(x)
if x(i)>=24
disp(x(i));
end
end

Categorie

Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange

Prodotti

Richiesto:

il 4 Giu 2020

Modificato:

il 4 Giu 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by