Export scan's results to excel using MacOS

3 次查看(过去 30 天)
Hello. I have apple computer and I have a problem to export results from scan mode into excel file for a visual population simulation. There is no export to excel file in MacOS, therefore, I have to install windows in Mac. I would like to know that does it have an export command for excel file in a scan mode for the new version of simbiology in MacOs.
Thank you in advance for your help!!
  2 个评论
Teerachat Saeheng
Hello, I downloaded the new version 2021b matlab and I used simbiology® in Macos. I would like to export 100 sheet (100 simulations) from the scan. I open the data sheet as you suggested; however, I cannot drag the result under the panel Last scan based on your suggestion. Could you please suggest me? I attacted the figure as below. Thank you for your help.
Best regards,
Teerachat Saeheng
Arthur Goldsipe
Arthur Goldsipe 2022-3-6
You need to drag a specific result rather than a folder. So, click on the triangle next to LastRun to expand it. Now, try dragging "results" into the data sheet.

请先登录,再进行评论。

采纳的回答

Florian Augustin
Florian Augustin 2021-7-28
Hello,
You should be able to export the simulation results on Mac as well as on Windows. Which version of Matlab are you using?
For example in R2021a, you can export simulation results via a Datasheet. First run the scan program. After the simulations finished, click on "New Datasheet" in the toolstrip of the SimBiology Model Analyzer and drag&drop the results (the results are located in the Browser panel under your Program -> LastRun). Then you can right-click on the table in the Datasheet and select "Export Datasheet".
I hope this helps. Let me know if you continue to have problems with exporting the data.
Best regards,
Florian
  3 个评论
Florian Augustin
Florian Augustin 2021-7-29
Hello,
SimBiology started to support exporting of simulation results to Excel on Mac in R2019b. If you want to work in R2018b on Mac you could write a script that manually writes the simulation results to Excel.
Here is an example that worked for me for results from a scan task. Feel free to use and tweak it to make it work for your application.
function dataTable = export2File(fileName, time, x, names)
% Get number of simulation runs
numRuns = numel(time);
% Collect run, time, and simulation data into one cell array.
tableCellData = cell(numRuns, 1);
for i = 1:numRuns
numTimeSteps = numel(time{i});
tableCellData{i} = [repmat(i, numTimeSteps, 1), time{i}, x{i}];
end
% Create a table from the collected data.
tableCellData = num2cell(vertcat(tableCellData{:}), 1);
dataTable = table(tableCellData{:});
dataTable.Properties.VariableNames = ['Run', 'Time', ...
matlab.lang.makeValidName(names{1}(:)')];
% Write table to a file.
writetable(dataTable, fileName);
end
This script assumes that no state name is called 'Run' or 'Time'. Copy-paste this script to a file named export2File.m. Then you can export data for "Time", t, "States", x, and "State names", names, from SimBiology in R2018b to the Matlab command line and call
export2File('scandata.xlsx', t, x, names);
I hope this helps.
Best regareds,
Florian
Teerachat Saeheng
Teerachat Saeheng 2021-7-29
Hello,
Thank you for your afford, I will try it.
Best regards,
Teerachat Saeheng

请先登录,再进行评论。

更多回答(0 个)

社区

更多回答在  SimBiology Community

类别

Help CenterFile Exchange 中查找有关 Import Data 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by