Values equal to zero in matrix
Mostrar comentarios más antiguos
Hello I have a data set as input for ANN, some of the value is equal to zero, lets say column number 3. Some of rows has zero value on the that column and other with nonzero value. Now, how I set up condition that will not read row that has zero value on column 3 on my prediction function.
prediction = zeros(1000, 1);
j = 1;
while (j<=4)
prediction(j,1) = cuRnet(input_data(j,:)');
j=j+1;
end
Respuestas (1)
James Tursa
el 18 de Jul. de 2017
Editada: James Tursa
el 18 de Jul. de 2017
E.g., if you want to test for that condition within the loop itself:
if( input_data(j,3) ~= 0 )
prediction(j,1) = cuRnet(input_data(j,:)');
end
Or you could create a test result for that column prior to the loop:
col3 = inputdata(:,3) ~= 0;
and then use that result within the loop:
if( col3(j) )
prediction(j,1) = cuRnet(input_data(j,:)');
end
1 comentario
yousef alsenani
el 18 de Jul. de 2017
Categorías
Más información sobre Deep Learning Toolbox en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!