How to access variable imported using import data tool?
6 次查看(过去 30 天)
显示 更早的评论
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
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.
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating, Deleting, and Querying Graphics Objects 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!