필터 지우기
필터 지우기

Change the name of the output file as a loop computes

조회 수: 2 (최근 30일)
Brenden
Brenden 2011년 7월 14일
Hello all,
What i want to do is create a stack of files... i have a function F(x,y,z) and it is set to run and calculate F at different z values something like:
for zloop=1:pixel_dimension;
z=zloop;
calculate the function based on x y and the changing z value F(x,y,z)
PSF=(abs(F)).^2;
% save images
imwrite(PSF, 'C:\Documents and Settings\User\My Documents\MATLAB\Deconvolution\Brenden\Deconvolution\Point Spread Function\PSF stack\ NAME .bmp', 'bmp');
end
What i want to know is how to change the name of the output file with each iteration so i dont "write over" the same file each time.

채택된 답변

Paulo Silva
Paulo Silva 2011년 7월 14일
for zloop=1:pixel_dimension;
z=zloop;
calculate the function based on x y and the changing z value F(x,y,z)
PSF=(abs(F)).^2;
% save images
imwrite(PSF, ['C:\Documents and Settings\User\My Documents\MATLAB\Deconvolution\Brenden\Deconvolution\Point Spread Function\PSF stack\' num2str(zloop) '.bmp'], 'bmp');
end
  댓글 수: 2
Brenden
Brenden 2011년 7월 14일
can i add more to the name than just the number zloop?? like name it PSF(zloop)??
Paulo Silva
Paulo Silva 2011년 7월 14일
just be careful not to add something that the OS won't allow for file names
[path string1 string2 ...]

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

추가 답변 (1개)

the cyclist
the cyclist 2011년 7월 14일
As the file input, create a string with the file name. For example,
filename = ['file',num2str(zloop),''];

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by