Values equal to zero in matrix

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
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

Categorías

Más información sobre Deep Learning Toolbox en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 18 de Jul. de 2017

Comentada:

el 18 de Jul. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by