Error using round(reshape(message,Mm*Nm,1)./256)
Afficher commentaires plus anciens
Hello,
What may be the problem with the following code line?
message=round(reshape(message,Mm*Nm,1)./256); using this I want to check message isn't too large to fit in cover image.
Where message=double(imread('lena.jpg')) and [Mm Nm] is the size of the message.
Thanks in advance
Réponses (2)
James Tursa
le 6 Nov 2014
1 vote
What does the error message say?
Double check the size of the variable message to make sure it really is Mm x Nm.
Note that you can replace reshape(message,Mm*Nm,1) with message(:)
2 commentaires
vaishali
le 6 Nov 2014
Modifié(e) : James Tursa
le 6 Nov 2014
James Tursa
le 6 Nov 2014
What is size(message)? In particular, what is size(message,3)?
Roger Stafford
le 6 Nov 2014
1 vote
Does 'lena.jpg' produce a third dimension for color? If so, that would account for your error message; you would have more than Mm*Nm elements in 'message'.
Catégories
En savoir plus sur Numeric Types dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!