MATLAB Answers

Error while using dec2bin() : too many input arguments

2 views (last 30 days)
when i run this code:
M = 'Hello';
% Now encode:
Mbinlong = reshape(dec2bin(double(M),7).',[],1)
I get this error :
Error using dec2bin Too many input arguments.
why this happens? How can i resolve this error?

  8 Comments

Show 5 older comments
Walter Roberson
Walter Roberson on 27 Feb 2017
Please show the output of
which -all dec2bin
R2013a did support passing the number of bits; see http://www.mathworks.com/help/releases/R2013a/matlab/ref/dec2bin.html
I think you are getting someone else's dec2bin
ANJANA KRISHNAN A
ANJANA KRISHNAN A on 27 Feb 2017
output of which -all dec2bin is :
F:\MATLAB\RSA\dec2bin.m
C:\Program Files\MATLAB\R2013a\toolbox\matlab\strfun\dec2bin.m % Shadowed
ANJANA KRISHNAN A
ANJANA KRISHNAN A on 27 Feb 2017
Thank you sir!! I think i was getting the dec2bin of the folder RSA!!Now i renamed that script.it's ok,right??

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 27 Feb 2017
You need to remove F:\MATLAB\RSA
from your MATLAB path. You can do that using pathtool

  1 Comment

Sign in to comment.

More Answers (0)

Sign in to answer this question.


Translated by