Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How do I get Matlab to recognise a text file as numerical values when importing it ?

1 回表示 (過去 30 日間)
Lavinia Trifoi
Lavinia Trifoi 2016 年 11 月 8 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I need to input all the data from this file into Matlab but have it recognize the txt as numerical values. I struggling on how to do that.
The file is at this link:

回答 (2 件)

George
George 2016 年 11 月 8 日
Check out the formatSpec portion of the textscan doc.

Walter Roberson
Walter Roberson 2016 年 11 月 8 日
%load a copy of the file locally
url = 'https://coastwatch.glerl.noaa.gov/statistic/ice/dat/g2011_2012_ice.dat'
tfile = [tempname '.dat'];
urlwrite(url, tfile);
%read it in
data = readtable(tfile);

Community Treasure Hunt

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

Start Hunting!

Translated by