Info

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

How can I rehuse an old Algorythm with a different input?

1 回表示 (過去 30 日間)
Juan Rosado
Juan Rosado 2013 年 2 月 16 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I have this code that organizes a text file obtained from the web into a cell array.
The code goes like this,
clc,clear all
fid = urlwrite('http://www.ndbc.noaa.gov/data/realtime2/41115.spec','Rincon.txt'); % URL from CARICOOS
Data = Rin;
Time = Data{1,1};
WVHT = Data{2}(:,1);
APD = Data{4}(:,1);
WWD = Data{3}(:,2);
The following is a function for the code above,
function Data = Rin
fid = fopen( 'Rincon.txt' );
Data = textscan( fid, '%d%d%d%d%d%f%f%f%f%f%s%s%s%f%f' ...
, 'Delimiter' , ' ' ...
, 'CollectOutput' , true ...
, 'HeaderLines' , 2 ...
, 'MultipleDelimsAsOne' , true ...
, 'Whitespace' , '' ...
);
fclose( fid );
end
I want to use this same code for a new text file but I can't get it to work.
The text file I am trying to apply this same code its in this web page/link.
Can anyone give me some suggestions to make this code work?
  1 件のコメント
Walter Roberson
Walter Roberson 2013 年 2 月 16 日
The new file has more input columns than the original. Which of the columns do you want to read in and how do they correspond to the columns needed in the original file ?

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by