How to continue loop when condition is met
Show older comments
I'm trying to set up a pattern recognition neural network. I have a 3D matrix: for example 300 x 100 x 5.
First file = 300 x 100 x 1
Second file = 300 x 100 x 2 and so on
One whole matrix is classified into one category. I have seen that the neural network app within MATLAB is sampled within rows or columns but my case is that it is sampled in matrices.
Since I have 100 channels, I tried creating separate variables for each channel so first variable will be known as the first channel which has 300 samples from the first file and second file and so on. Therefore, the format will be acceptable by the neural network app.
I tried implementing this but currently am stuck with the logic behind it in the code. The code is meant to go from (:,1,1) to (:,1,2) to (:,1,3) and so on. Once the condition is met of the file limit, it is meant be (:,2,1) then (:,2,2) and so on. This code currently goes from (:,1,1) to (:,2,2) and so on. Is there a way to implement the condition to stop this from happening? Many thanks.
channels = 100;
a = a; %num of dev files
for i = 1:100 %num of channels
for ii = 1:a %num of files
devinputdata(:,ii) = (devarray(:,1,ii));
end
end
1 Comment
BERGHOUT Tarek
on 16 Apr 2019
is that what you need? i hope it is.
for i = 1:100 %num of channels
for ii = 1:a %num of files
devinputdata(:,i,ii) = (devarray(:,i,ii));
end
end
Answers (0)
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!