write a script to write another new .dat

I have to write a script which can write the data to a new .dat file. I already have a vector = [2000 3000 4000 7000 11000; 300 293 275 246 200], and I save as a.dat
Here we I got
load a.dat
time = a(1,:);
temp = a(2,:);
plot (time,temp,'k--')
now, I have to write an another .dat maintain different number of vector, and I have to write it on the script that i have(which is above script) and name it by b.dat.

댓글 수: 4

What do you want to save in the second file?
save('b.mat', 'variablename');
will do the job.
david Chan
david Chan 2014년 10월 26일
another like vector = [2000 3000 4000 7000 11000; 300 293 275 246 200] for example vector = [1 2 3 4 5; 100 200 300 400 500] save as b.dat however, i have to write it in one script without open another one.
dpb
dpb 2014년 10월 26일
Simply add to the existing script (or write a separate function and call it from the first script).
david Chan
david Chan 2014년 10월 26일
that's what I asking for, I don't know which code should I use

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink에 대해 자세히 알아보기

태그

질문:

2014년 10월 26일

댓글:

2014년 10월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by