Ask Your Question

Revision history [back]

Convert Mat 5x5 to Vector

This is Matrix 5x5 , I want to convert it to vector. But it failed. I use reshape(0,1) and the error says bad number of row.

[ 3.76666679e+001, -1., 40., -1., 3.06666660e+001, -1.,3.06666660e+001, -1., 27., -1.,

40., -1., 4.46666679e+001, -1.,3.53333321e+001, -1., 3.43333321e+001, -1., 30., -1., 3.06666660e+001, -1., 3.53333321e+001, -1., 3.03333340e+001, -1.,28., -1., 24., -1., 3.06666660e+001, -1., 3.43333321e+001, -1., 28., -1., 29., -1., 25., -1., 27., -1., 30., -1., 24., -1., 25.,-1., 2.23333340e+001, -1. ]

Any somebody knows my problem? My code always difficult to reshape. Thank you

click to hide/show revision 2
No.2 Revision

updated 2017-01-25 04:30:05 -0600

berak gravatar image

Convert Mat 5x5 to Vector

This is Matrix 5x5 , I want to convert it to vector. But it failed. I use reshape(0,1) and the error says bad number of row.

 [ 3.76666679e+001, -1., 40., -1., 3.06666660e+001, -1.,3.06666660e+001, -1., 27., -1.,
-1.,

40., -1., 4.46666679e+001, -1.,3.53333321e+001, -1., 3.43333321e+001, -1., 30., -1., 3.06666660e+001, -1., 3.53333321e+001, -1., 3.03333340e+001, -1.,28., -1., 24., -1., 3.06666660e+001, -1., 3.43333321e+001, -1., 28., -1., 29., -1., 25., -1., 27., -1., 30., -1., 24., -1., 25.,-1., 2.23333340e+001, -1. ]

]

Any somebody knows my problem? My code always difficult to reshape. Thank you