How to save Output filename as per Input file name?

조회 수: 5 (최근 30일)
Ram Krishna Mazumder
Ram Krishna Mazumder 2013년 4월 23일
I am a new user of Matlab... I have a input file name 'GM.txt' My Script are as below:
I=load('GM.txt'); A=I; D1=A(:,2); D2=A(:,3); D3=A(:,4); r1=max([max(D1),abs(min(D1))]); r2=max([max(D2),abs(min(D2))]); r3=max([max(D3),abs(min(D3))]); D=[r1 r2 r3 r1-r2 r2-r3 r3] save GM.out D -ASCII
I want such 'save' command when I will change my input file name (for ex- Spectra.txt) that command will give me a 'Spectra.out' file automatically.

답변 (1개)

Tobias
Tobias 2013년 4월 23일
You need to look into functions and use your filename as input.

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT-Files에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by