How to define a range to iterate with gaps in between?

3 visualizaciones (últimos 30 días)
mathango
mathango el 3 de Mayo de 2016
Respondida: Azzi Abdelmalek el 3 de Mayo de 2016
Hi,
Is it possible to do iteration with gaps in simple and fast format in matlab.
For example,
i= 1:10;
j= 15:20;
k= 25:30;
goal => iterate M from 1 to 30 except at the gaps between 10 : 15, and 20 :25 .
The purpose of this is to avoid calling a function to iterate three times.

Respuesta aceptada

CS Researcher
CS Researcher el 3 de Mayo de 2016
Try this:
range = [1:10, 15:20, 25:30];

Más respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 3 de Mayo de 2016
for k= [1:10 15:20 25:30]

Categorías

Más información sobre Get Started with MATLAB 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