function saveas output format (how to save a plot in for loop and specific location)
显示 更早的评论
Hi Everyone,
I'm having difficulties with 'saveas' function. This is the only output format I can find:
saveas(H,'FILENAME','FORMAT')
I am looking for an example output format for this function for how to add a changing file name (for each for loop iteration) and how to add location (where I want the files to be saved).
My question:
I have the following command (taken from an inside of a for loop):
hist_pat=figure
histogram(log_band_power) %matrix of 114x5 data
title(strcat('logged-data '+ currentSubject + ' parc60')); %plot title changes with each loop; different patient
saveas(hist_pat, '') % hist_pat is the plot I want to save, '' is for the name of the plot; the problem
...where should I add the following to the [saveas (hist_pat, '')] line of code:
changing name and location: (strcat(dataLoc, 'log_check/log_histogram', currentSubject, 'log.svg'),'hist_pat')
I know the layout will be differnet of the line above, but I can't find any examples online on how to structure that line of code.
Any suggestions?
Thank You!
回答(1 个)
Vyte Jan
2022-9-20
0 个投票
类别
在 帮助中心 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!