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

Risposte (1)

James Tursa
James Tursa il 18 Lug 2017
Modificato: James Tursa il 18 Lug 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

Categorie

Scopri di più su Deep Learning Toolbox in Centro assistenza e File Exchange

Tag

Richiesto:

il 18 Lug 2017

Commentato:

il 18 Lug 2017

Community Treasure Hunt

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

Start Hunting!

Translated by