Matlab

%open Excel via ActiveX
Excel = actxserver('Excel.Application');
set(Excel, 'Visible', 1);
%open your existing workbook in Excel
Workbooks = Excel.Workbooks;
Workbook = invoke(Workbooks, 'Open','PATH\YOUR_FILE.xls');
%make your sheet active (in this case, first sheet)
Sheets = Excel.ActiveWorkBook.Sheets;
sheet1 = get(Sheets, 'Item', 1);
invoke(sheet1, 'Activate');
Activesheet = Excel.Activesheet;
%%%Begin loop
%capture the range and value of your parameter data in Excel
%NOTE: you can either try to capture all of the paramters for a simulation at once
%and then sort them in MATLAB or capture each factor one by one
Range1 = get(Activesheet, 'Range', 'XX', 'YY');
val = Range1.value;
val = reshape([val{:}], size(val));
%set factors for your model and run simulation from command line
set_param(MODELNAME, 'param1','val')
sim(MODELNAME)
%create StopFcn callback to save the simulated output data to workspace
%after simulation is run, capture range and place output data in Excel
Range2 = get(Activesheet, 'Range', 'XX2', 'YY2');
set(Range2, 'Value', output);
% save the workbook
invoke(Workbook, 'SaveAs', 'myfile.xls');
%%%End loop
% quit Excel
invoke(Excel, 'Quit');

Place new order. It's free, fast and safe

-+
550 words

Our customers say

Customer Avatar
Jeff Curtis
USA, Student

"I'm fully satisfied with the essay I've just received. When I read it, I felt like it was exactly what I wanted to say, but couldn’t find the necessary words. Thank you!"

Customer Avatar
Ian McGregor
UK, Student

"I don’t know what I would do without your assistance! With your help, I met my deadline just in time and the work was very professional. I will be back in several days with another assignment!"

Customer Avatar
Shannon Williams
Canada, Student

"It was the perfect experience! I enjoyed working with my writer, he delivered my work on time and followed all the guidelines about the referencing and contents."

  • 5-paragraph Essay
  • Admission Essay
  • Annotated Bibliography
  • Argumentative Essay
  • Article Review
  • Assignment
  • Biography
  • Book/Movie Review
  • Business Plan
  • Case Study
  • Cause and Effect Essay
  • Classification Essay
  • Comparison Essay
  • Coursework
  • Creative Writing
  • Critical Thinking/Review
  • Deductive Essay
  • Definition Essay
  • Essay (Any Type)
  • Exploratory Essay
  • Expository Essay
  • Informal Essay
  • Literature Essay
  • Multiple Choice Question
  • Narrative Essay
  • Personal Essay
  • Persuasive Essay
  • Powerpoint Presentation
  • Reflective Writing
  • Research Essay
  • Response Essay
  • Scholarship Essay
  • Term Paper
We use cookies to provide you with the best possible experience. By using this website you are accepting the use of cookies mentioned in our Privacy Policy.