필터 지우기
필터 지우기

Output data from multiple plot into columns in a single file

조회 수: 1 (최근 30일)
kayak
kayak 2013년 10월 17일
댓글: kayak 2013년 10월 18일
Hi All, I am making several plots on each other using the command:
{
figure(1); clf
for i=1:2:length(data)
plot(data{i}.number,data{i}.amount);
hold all
end
}
where data{i}.number should be identical for all data{i}.amount.
Now I am interested in writing the values of each plot into a .txt file so I can process it elsewhere. I have tried:
{
for i=2:2:length(data)
dlmwrite('amount.txt', [data{i}.number, data{i}.amount],'delimiter','\t');
end
hold all
}
but it only writes one dataset. What I want is an 'amount.txt' file with the following column format:
{
data{i}.number data{1}.amount data{2}.amount data{3}.amount ...
}
can someone please help?
  댓글 수: 2
Nishitha Ayyalapu
Nishitha Ayyalapu 2013년 10월 17일
To clarify, "number" and "amount" for each dataset "data{i}" both vectors or scalars?
kayak
kayak 2013년 10월 18일
Hi Nishitha, Thanks. "number" and "amount" are both vectors.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Text Files에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by