from MATLAB command line , when I type my variable a , it gives me values as expected :
a =
value_1
value_2
and I wou
Perhaps a
is a string with a newline in it. To make two separate variables, try:
values = strtrim(strread(a, '%s', 'delimiter', sprintf('\n')))
strread
will split a into separate lines, and strtrim
will remove leading/trailing whitespace.
Then you can access the lines using
values{1}
values{2}
(note that you must use curly brackets since this is a cell array of strings).