Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

How to define a matrix with 5000 specific elements

$
0
0
Hello, I need to define a matrix M, M is 5000*2. In matlab, M=[1,45;89,3;....], it's not regular, so I can't define it in a loop. In my code I tried to define it like Mat M = (Mat_(num, 3) << 994, 323, 0, 4014, 4295, 4395, 4906, 3423, 2792.....); But when I use `printf("number: %f", M.at(2, 1)`, it gives me 0. So could anyone tell me how to define such a matrix like in matlab M=[1 2 3; 4 5 6;....]

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>