Why does using a comma decimal separator only work for data with more than one column?

When using
readmatrix(filename,"DecimalSeparator",",")
on a TXT file with multiple columns such as below, it works as expected.
 
Before:
0,1 0,2
0,3 0,4
After:
0.1 0.2
0.3 0.4
When the data only has one column, however, the command does not produce the desired results.
Before:
0,1
0,3
After:
0 1
0 3
How can I use "readmatrix" for a one column TXT file with comma decimal separators?

 采纳的回答

In this case, it will be necessary to define the delimiter as an additional input argument:
readmatrix(filename,"DecimalSeparator",",","Delimiter"," ")

更多回答(0 个)

产品

Community Treasure Hunt

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

Start Hunting!

Translated by