How to collect it by using loop
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
SYED AQEEL HAIDER
el 4 de Dic. de 2018
Comentada: SYED AQEEL HAIDER
el 4 de Dic. de 2018
In response of statement
[J,K] = find(Image);
I have got J and K of size [14,1]
Now I want to locate
R1 = [J(1), K(1)]
R2 = [J(2), K(2)] and so on till R14 = [J(14), K(14)]
How to complete this task using loop?
2 comentarios
Stephen23
el 4 de Dic. de 2018
You tagged this question with "changing variable name for each iteration", but it is important to learn that magically changing variable names is one way that beginners force themselves into writing slow, complex, buggy code that is hard to debug. Read this to know why:
The MATLAB documentation and all experienced MATLAB users reccomend using indexing. Indexing is neat, simple, very efficient, and easy to debug. Unlike what you are trying to do.
Respuesta aceptada
madhan ravi
el 4 de Dic. de 2018
Don't name the variable dynamically use cell instead
R=cell(1,14); % preallocation
for i=1:14
R{i}=find(image);
end
celldisp(R)
3 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with MATLAB en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!