我有精度损失的问题。我使用以下代码将一组值从 CSV 文件导入 MATLAB 7:
function importfile(fileToRead1)
%#IMPORTFILE(FILETOREAD1)
%# Imports data from the specified file
%# FILETOREAD1: file to read
DELIMITER = ',';
HEADERLINES = 0;
%# Import the file
rawData1 = importdata(fileToRead1, DELIMITER, HEADERLINES);
%# For some simple files (such as a CSV or JPEG files), IMPORTDATA might
%# return a simple array. If so, generate a structure so that the output
%# matches that from the Import Wizard.
[~,name] = fileparts(fileToRead1);
newData1.(genvarname(name)) = rawData1;
%# Create new variables in the base workspace from those fields.
vars = fieldnames(newData1);
for i = 1:length(vars)
assignin('base', vars{i}, newData1.(vars{i}));
end
这个非常基本的脚本只需要指定的文件:
> 14,-0.15893555
> 15,-0.24221802
> 16,0.18478394
并将第二列转换为:
14 -0,158935550000000
15 -0,242218020000000
16 0,184783940000000
但是,如果我使用数据光标选择一个点,它只会显示 3 或 4 位精度:
有没有办法对更高的精度进行编程以获得更精确的数据点?