Borrar filtros
Borrar filtros

use of loop with matrix

1 visualización (últimos 30 días)
Fiboehh
Fiboehh el 7 de Mayo de 2011
Hellow i'm freaking out of matlab :p matrix D = [1 7 8 12 14 15] i want to use every value of the matrix in a loop. So the loop goes for 6 times (D has 6 elements) and the value of d is the value of the elements.
i have:
for d=1:D(end)
if d>10
% now various calculations with d , in this example 12 14 and 15
please help

Respuesta aceptada

Walter Roberson
Walter Roberson el 7 de Mayo de 2011
for d=D
if d>10
%whatever
end
end

Más respuestas (1)

Fiboehh
Fiboehh el 7 de Mayo de 2011
super! it works, hero :D

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by