4 views (last 30 days)

Show older comments

1.) I am trying to make this string [0,1,2,3,4,5,6,7,8,9,0xA,0xB] as an input the convert to decimal value and/or binary?

Is this possible?

0xA = 10

0xB = 11

they are both Hex inputs.

2.) Then I am trying to convert this string of values to Chars.

Here is what I am got so are with the error:

Array = [0,1,2,3,4,5,6,7,8,9,0xa,0xb]

Array = dec2hex(Array)

Array = convertStringsToChars(Array)

Here is the output showing on the command window.

>> untitled2

Error: File: untitled2.m Line: 12 Column: 32

Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax

error. To construct matrices, use brackets instead of parentheses.

James Tursa
on 15 Dec 2020

What I mean is that for this specific example you gave:

Array = [0,1,2,3,4,5,6,7,8,9,0xa,0xb]

which contains 12 double values, what exactly is your desired output? I don't mean a description ... I mean the exact output you want for that exact input.

Steven Lord
on 15 Dec 2020

Array = [0,1,2,3,4,5,6,7,8,9,0xa,0xb]

From the fact that Code Analyzer flags this as an error, are you certain you're using release R2020a? Can you post the output of this command in your installation of MATLAB to confirm that?

version

Steven Lord
on 15 Dec 2020

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!