フィルターのクリア

Trying to use fscanf and nested for loops

3 ビュー (過去 30 日間)
Ian Barker
Ian Barker 2013 年 3 月 8 日
So i have an assignment due in a few hours. I'm supposed to extract hurricane data from a text file, turn it into a matrix and then get some of the data out of it.
The last part would be easy enough but I can't figure out how to correctly use fscanf inside of a for loop. I've taken a look at the documentation and done some trial and error for about an hour and gotten nowhere. I can't get fscanf to give me individual columns of the data set, instead it just spits out either the whole thing or an error message.
BTW the data looks like this, split up by year, ACE number, and number of tropical storms.
2001 106 15
2002 65 12
2003 175 16
2004 225 14
2005 248 28
2006 79 10
2007 72 15
2008 145 16
2009 51 9
2010 62 7
  2 件のコメント
TAB
TAB 2013 年 3 月 8 日
Cedric
Cedric 2013 年 3 月 8 日
編集済み: Cedric 2013 年 3 月 8 日
If you don't know how to proceed with FSCANF, read the doc of FILEREAD and STR2NUM.
>> doc fileread
>> doc num2str
If you want to do it using FSCANF, please post your current code so we can discuss it.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeString Parsing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by