Values equal to zero in matrix
Show older comments
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
Answers (1)
James Tursa
on 18 Jul 2017
Edited: James Tursa
on 18 Jul 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 Comment
yousef alsenani
on 18 Jul 2017
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!