How to access variable imported using import data tool?

11 ビュー (過去 30 日間)
Georgie Taylor
Georgie Taylor 2016 年 1 月 18 日
編集済み: Stephen23 2016 年 1 月 18 日
Sorry in advance for any poor use of terminology, I'm a bit rusty.
I'm trying to read a 4-column .dat file with double spaced delimiters and header and footer lines that need to be excluded, so used the import data button. I selected the data range and delimiters I wanted, and used column vectors to store the data.
After clicking import selection, I can double click on the 'w' variable in the workspace, and all of the data is correctly stored.
However, when I try print w in the command window
if true
% w
end
I get values that are mostly 0.0000 entries, with a few (inaccurate) numbers present. I won't post the whole output as the data set is quite large, but the smallest value in w should be 50, so the following output indicates to me something is going wrong somewhere. Help?
>> testcode
w =
1.0e+08 *
6.0000
2.0000
0.1200
0.0100
0.0060
0.0025
0.0012
0.0005
0.0005
0.0005
0.0005
0.0005
0.0004
0.0004
0.0004
0.0004
0.0004
0.0004
0.0004
0.0004
0.0004
  1 件のコメント
Stephen23
Stephen23 2016 年 1 月 18 日
編集済み: Stephen23 2016 年 1 月 18 日
There is nothing wrong with your data, the values are not "inaccurate", they are simply displayed with a common multiplier at the beginning:
w =
1.0e+08 * <- this is a factor of all displayed values below!
6.0000
2.0000
0.1200
0.0100
...
MATLAB uses one factor to allow the displaying of numbers with many different magnitudes, without cluttering up the screen with lots of exponents.

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

採用された回答

Walter Roberson
Walter Roberson 2016 年 1 月 18 日
Give the command
format long g
and look at the data again.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by