MATLAB: Convert numeric values to ASCII code ascii I want to convert numeric values of time and amplitude to ASCII code. I tried many functions but i haven't got success so far. Example: t=2.5 t=50 46 53 Best Answer Try this:t = 2.5;Out = int64(num2str(t))Out1 = 1×3 int64 row vector 50 46 53 Related SolutionsMATLAB: Remove repeated values in a CSV string mystring = '1,1,1,25,33,33,5,5,3,2,1,1' iwant = join(unique(split(string(mystring),',')),',')results in a string:mystring = '1,1,1,25,33,33,5,5,3,2,1,1'iwant = "1,2,25,3,33,5"Note, that you speak of string, but use char type. if you want char as result use this instead:iwant = char(join(unique(split(string(mystring),',')),',')) MATLAB: Insert comma/point in a number I am not certain what you are doing.I assume ‘char’ is a character vector. If so, this will work:char = '225800';t = str2double(char)*1E-4 % Double-Precision Numerictstr = sprintf('%.2f', t) % Character Arrayt = 22.5800tstr = '22.58' Related QuestionFail to convert string to a numberExport numeric array to ASCII file using save
Best Answer