Right now I am able to do calculations of two excel file data and output its result to the 3rd excel file which is already existing. Now I want to do two things :
  1. It should create a new excel file and store the calculated result in it.
  2. After storing the result in the newly created file it should open that new file on the screen,showing the results.
Can anyone tell me what script should I add to my existing code to get this kind of result?

 채택된 답변

Image Analyst
Image Analyst 2014년 7월 28일

0 개 추천

You say you already have the 3rd workbook, so for #1, why can't you just use copyfile() to make another one?
For #2, use the system() command to launch Excel workbook
system('D:\Matlab\work\Camera Noise Comparison.xlsx')

댓글 수: 5

KRUNAL
KRUNAL 2014년 7월 29일
I have created script where I am storing the resulting output in a existing file but I want the matlab to create the file instead of me creating 1st and then storing the result in it.. SO I am doing #1. Hope so I am clear with my question
Joseph Cheng
Joseph Cheng 2014년 7월 29일
the xlswrite() function will create an excel file for you without having to generate one in excel first. if you already have an excel file that contains the exact same contents why not just follow Image Analyst method and copyfile() as it'll be less cumbersome than reading and re-writing what is in the excel #3 file.
KRUNAL
KRUNAL 2014년 7월 29일
By the way thanks Image Analyst for the #2. It worked !
Image Analyst
Image Analyst 2015년 9월 18일
Jamal's "Answer" moved here:
Dear Image Analyst,
Thanks for your method; I need it and works well for me. But my code produces about 120 input packages automatically and I need to create 120 excel files. I would prefer to give a specific name to each (e.g. ordinal numbers) , How can I automate this in xlswrite line please?
Many thanks, Jamal

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

추가 답변 (2개)

Joseph Cheng
Joseph Cheng 2014년 7월 28일

0 개 추천

the first one should be easy enough as you know how to read the first 2 excel files and you can write to the 3rd excel file. use the xlswrite but have an input name or generic name. the second one would be to use winopen() function to open the file in excel showing the results.

댓글 수: 2

KRUNAL
KRUNAL 2014년 7월 29일
I did not get you. What kind of input name or generic name should I add?
Joseph Cheng
Joseph Cheng 2014년 7월 29일
That is for you to decide.

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

KRUNAL
KRUNAL 2014년 7월 29일

0 개 추천

Ok I got. Thanks Joseph!

카테고리

질문:

2014년 7월 28일

댓글:

2015년 9월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by