This code is weird.
In each iteration of "index" you fill either a matrix temp or a matrix temp_noise with m rows of values.
Then you concatenate only the last (= ii-th) row of both of these matrices into a single row, and store this in the variable table. One the of these last rows was just created, and for the other one you use the one created one or more iterations ago.
At every subsequention iteration, this variable table is overwritten.
So, first you need to carefully think about what you are trying to do ....
3 Comments
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/481845-to-concatenate-rows-in-matrix-within-for-loop-based-on-if-else-statement#comment_749291
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/481845-to-concatenate-rows-in-matrix-within-for-loop-based-on-if-else-statement#comment_749291
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/481845-to-concatenate-rows-in-matrix-within-for-loop-based-on-if-else-statement#comment_749345
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/481845-to-concatenate-rows-in-matrix-within-for-loop-based-on-if-else-statement#comment_749345
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/481845-to-concatenate-rows-in-matrix-within-for-loop-based-on-if-else-statement#comment_750082
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/481845-to-concatenate-rows-in-matrix-within-for-loop-based-on-if-else-statement#comment_750082
Sign in to comment.