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
回答 (1 件)
James Tursa
2017 年 7 月 18 日
編集済み: James Tursa
2017 年 7 月 18 日
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
カテゴリ
ヘルプ センター および File Exchange で Deep Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!