Prev: How to get back data using Calllib to DLL
Next: how to make some private or protected object's field public?
From: Eric Brewer on 26 Feb 2010 10:03 I am trying to generate Simulink reports from the command line using a given template (.rpt) file. I have a report template (ReportTemplate.rpt) and a Simulink model (model.mdl). In the command line, if I type "report model", I get the standard full report for the model. If I type "report ReportTemplate", I will only get a report on my model using the template if the model is opened, otherwise I get a report for a standard simulink blockset. Is there a way to generate a report for "model.mdl" using the template without opening the model? Thanks in advance! -Eric
From: Arkadiy Turevskiy on 1 Mar 2010 17:27 My guess is that your ReportTemplate.rpt is based on some standard shipping report template files, like simulink-default.rpt The first component of your rpt file is probably if component ith this text expression: isempty(find_system('SearchDepth',1,'BlockDiagramType','model')) The second component is probably Evaluate MATLAB Expression with this code: %if no models are open, open f14 f14 The combined effect of these two components is to see if any model is open when you execute a report, and if not, to open f14 model by default. To open your model if no models are open simply change the code in Evaluate MATLAB Expression component to: %if no models are open, open model model Hope this helps. Let me know if this helped or if something else is happening. Arkadiy "Eric Brewer" <piano_man354(a)yahoo.com> wrote in message <hm8nr8$69u$1(a)fred.mathworks.com>... > I am trying to generate Simulink reports from the command line using a given template (.rpt) file. I have a report template (ReportTemplate.rpt) and a Simulink model (model.mdl). In the command line, if I type "report model", I get the standard full report for the model. If I type "report ReportTemplate", I will only get a report on my model using the template if the model is opened, otherwise I get a report for a standard simulink blockset. Is there a way to generate a report for "model.mdl" using the template without opening the model? Thanks in advance! > > -Eric
From: Eric Brewer on 2 Mar 2010 13:10 "Arkadiy Turevskiy" <arkadiy.turevskiy(a)mathworks.com> wrote in message <hmhevo$qae$1(a)fred.mathworks.com>... > My guess is that your ReportTemplate.rpt is based on some standard shipping report template files, like simulink-default.rpt > > The first component of your rpt file is probably if component ith this text expression: > isempty(find_system('SearchDepth',1,'BlockDiagramType','model')) > > The second component is probably Evaluate MATLAB Expression with this code: > > %if no models are open, open f14 > f14 > > The combined effect of these two components is to see if any model is open when you execute a report, and if not, to open f14 model by default. > > To open your model if no models are open simply change the code in Evaluate MATLAB Expression component to: > > %if no models are open, open model > model > > Hope this helps. Let me know if this helped or if something else is happening. > Arkadiy > > > "Eric Brewer" <piano_man354(a)yahoo.com> wrote in message <hm8nr8$69u$1(a)fred.mathworks.com>... > > I am trying to generate Simulink reports from the command line using a given template (.rpt) file. I have a report template (ReportTemplate.rpt) and a Simulink model (model.mdl). In the command line, if I type "report model", I get the standard full report for the model. If I type "report ReportTemplate", I will only get a report on my model using the template if the model is opened, otherwise I get a report for a standard simulink blockset. Is there a way to generate a report for "model.mdl" using the template without opening the model? Thanks in advance! > > > > -Eric Arkadiy, Thanks for the response. Unfortunately, I can't find the if statements that you mention. Also, I believe this would make the template specific to one model. Is there any way to pass in the model name to a function, such that I can generate the report from this template regardless of the model name? Thanks in advance. -Eric
From: Arkadiy Turevskiy on 2 Mar 2010 14:17 if you have a model file model.mdl and report setup file reportcustom.rpt, >>myreport('model','reportcustom.rpt') where function [ ] = myreport(mymodelname,myreportname) % Model must be loaded. load_system(mymodelname) % Associate model with report name. Needs to be done once if saved. set_param(mymodelname,'ReportName',myreportname) save_system(mymodelname); % Generate report. report(mymodelname) close_system(mymodelname) end Arkadiy > Arkadiy, > Thanks for the response. Unfortunately, I can't find the if statements that you mention. Also, I believe this would make the template specific to one model. Is there any way to pass in the model name to a function, such that I can generate the report from this template regardless of the model name? Thanks in advance. > > -Eric
From: Eric Brewer on 2 Mar 2010 14:55 "Arkadiy Turevskiy" <arkadiy.turevskiy(a)mathworks.com> wrote in message <hmjo7h$il5$1(a)fred.mathworks.com>... > if you have a model file model.mdl and report setup file reportcustom.rpt, > > >>myreport('model','reportcustom.rpt') > > where > > function [ ] = myreport(mymodelname,myreportname) > % Model must be loaded. > load_system(mymodelname) > % Associate model with report name. Needs to be done once if saved. > set_param(mymodelname,'ReportName',myreportname) > save_system(mymodelname); > % Generate report. > report(mymodelname) > close_system(mymodelname) > end > > Arkadiy > > > Arkadiy, > > Thanks for the response. Unfortunately, I can't find the if statements that you mention. Also, I believe this would make the template specific to one model. Is there any way to pass in the model name to a function, such that I can generate the report from this template regardless of the model name? Thanks in advance. > > > > -Eric That's exactly what I was looking for. Thanks!
|
Next
|
Last
Pages: 1 2 Prev: How to get back data using Calllib to DLL Next: how to make some private or protected object's field public? |