reading excel file NUMERIC DATA. PROBLEM: multiple data in single column single row. how to extract required data .Note: there are 4 blanks between each value but 3 if next value is negative.

1 回表示 (過去 30 日間)
Multiple data in a single column. need to extract the indivitual data..
i need to use the excel file that has data in a single column , single row like:
"60.00000000 4993.08359390 -1072.91939781 4757.18964226 -5.233862561 -0.282145111 -5.442921539"
now i need to use first 4 values individually that are:
"60.00000000,,,,4993.08359390,,,-1072.91939781,,,,4757.18964226"
where each , represents a blank space.
W=60.00000000; X=4993.08359390; Y=-1072.91939781; Z=4757.18964226;
one thing to not is that there are 4 blanks between each value but if the next value is negative then there are 3 blanks.
how is it suggested that i do that.
NOTE: i have many rows. i will increment row at each loop.
as a total beginner so a simplified answer will be appreciated..
thanks in advance
  3 件のコメント
usama amjid
usama amjid 2015 年 7 月 9 日
@star strider. excel file attached.

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

回答 (1 件)

Alex
Alex 2015 年 7 月 8 日
Try this: [~,txt]=xlsread(xlsfilename);
Does it return all the data as text? If so, then you you can use a fgetl/for loop or use textscan to parse them. It depends how it reurn the data.
Hope this helps.

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by