matlab - Save data as modified input file name -


i have program loads data .txt file , performs curve fitting. input file name example experiment09.txt.

after processing want save variable same input filename appended _fit. saved workspace variable in case experiment09_fit.txt.

i have gotten far in matlab:

buf = length(filename) savename = filename(1:buf-7) 

which gives me savename of experiment09 @ loss how add chosen string on end make experiment09_fit. once have valid save name call

save(savename, 'fittedvalue', '-ascii'); 

help appreciated.

what this:

filename = 'experiment09.txt'; [pathstr, basename, ext] = fileparts(filename); outname = [basename, '_fit', ext]; % give 'experiment09_fit.txt' 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -