MATLAB: Do I receive an error when using the DEC2HEX function in MATLAB 7.0 (R14)

arraysdec2hexMATLABvector

When I type the following code:
dec2hex([[2,3,4];[7,8,9]])
I receive the following error:
??? Operands to the || and && operators must be convertible to logical
scalar values. Error in ==> dec2hex at 23 if ~isreal(d) || any(d < 0) ||
any(d ~= fix(d))

Best Answer

This bug has been fixed for Release 14 SP1 (R14SP1). For previous releases, please read below for any possible workarounds:
This has been verified as a bug in MATLAB 7.0 (R14) in the way that the DEC2HEX function handles matrix data.
Currently, to work around this issue, use the following code:
x=[[2,3,4];[7,8,9]];
dec2hex(x(:))