running a set of numbers through a program

I have a region growing code where the input for the code looks like this.
I = im2double(imread('medtest.png'));
x=198; y=359;
J = regiongrowing(I,x,y,0.2);
figure, imshow(I+J);
I need to run it multiple times using a set of coordinates such as
x = [1,2,3]
y = [4,5,6]
If anyone has anysuggestions i would greatly appreciate it.
-Eric

1 comentario

What does run it multiple times using a set of coordinates such as
x = [1,2,3] y = [4,5,6]
really mean, precisely? You mean three consecutive runs w/
[x y]=[1 4];
etc., or somehow are the vectors supposed to be the arguments?
If the former, why isn't just a simple loop enough?

Iniciar sesión para comentar.

 Respuesta aceptada

Walter Roberson
Walter Roberson el 30 de Jul. de 2013
I = im2double(imread('medtest.png'));
X = [1 2 3]; Y = [4 5 6];
for K = 1 : length(X)
x = X(K); y = Y(K);
J = regiongrowing(I,x,y,0.2);
figure, imshow(I+J);
end

Más respuestas (0)

Categorías

Más información sobre Programming en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 30 de Jul. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by