Importing Data to Matlab

前端 未结 1 1376
孤独总比滥情好
孤独总比滥情好 2021-01-26 04:51

I have a csv-file with data I want to import into Matlab. Since it is a mix of date and numbers I use:

data = textscan (fid,\'%s%s%n%n%n%n%n\',819500,\'headerlin         


        
相关标签:
1条回答
  • 2021-01-26 05:16

    Matlab often truncates the display of numbers to four decimal places, which is what may be happening. To check this, try forcing the formatting to five decimal places using fprintf:

    >>> myNum = 1.24028;
    >>> fprintf("%.5f", myNum)
    
            1.24028
    

    Or by changing the formatting:

    >>> myNum = 1.24028;
    >>> format long
    >>> myNum
    
        myNum = 
    
        1.2402800000
    
    0 讨论(0)
提交回复
热议问题