필터 지우기
필터 지우기

Only write floating points and/or avoiding scientific notation when using dlmwrite

조회 수: 6 (최근 30일)
Hi,
I have this piece of code but it writes some of my outputs in scientific notation. I would like to keep the numbers as floating points instead. Open to any suggestions.
filein is an input in my function. It is meant to be a text file with several columns and rows. Then it filters out the rows that have n in the column column (variable column, also a function input). The filtered rows are then written in a new file fileout ( a function output).
data = dlmread(filein);
data_new = data(data(:,column) > n,:); % isolating files with A > n
fileout = fileoutname;
dlmwrite(fileout,data_new,'delimiter',' ');
% In case it would make it easier, here is my function setup
[fileout] = excludeA(filein,n,column,fileoutname)
Thanks in advance

채택된 답변

madhan ravi
madhan ravi 2019년 4월 7일
Use dlmwrite() with precision option.

추가 답변 (0개)

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by