0

这是我程序中的一段代码

%read in the message image and reshape it into a vector
file_name='innocence.bmp';
message=double(imread(file_name));
Mm=size(message,1);   %height 
Nm=size(message,2);   %Width 
message_vector=round(reshape(message,Mm*Nm,1)./2);

我收到此错误

??? Error using ==> reshape
TO RESHAPE the number of elements must not change.
Error in ==>dwt at 31  message_vector=round(reshape(message,Mm*Nm,1)./2);

我究竟做错了什么?

4

1 回答 1

0

如果您只想将 [Mm x Nm] 矩阵重塑为 [1 x Mm*Nm] 向量,您可以使用:

message_vector=round(message(:)/2);
于 2013-01-26T09:16:06.723 回答