Export scan's results to excel using MacOS

3 Ansichten (letzte 30 Tage)
Teerachat Saeheng
Teerachat Saeheng am 27 Jul. 2021
Kommentiert: Arthur Goldsipe am 6 Mär. 2022
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 Kommentare
Teerachat Saeheng
Teerachat Saeheng am 5 Mär. 2022
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 am 6 Mär. 2022
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.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Florian Augustin
Florian Augustin am 28 Jul. 2021
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 Kommentare
Florian Augustin
Florian Augustin am 29 Jul. 2021
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 am 29 Jul. 2021
Hello,
Thank you for your afford, I will try it.
Best regards,
Teerachat Saeheng

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Communitys

Weitere Antworten in  SimBiology Community

Kategorien

Mehr zu Import Data finden Sie in Help Center und File Exchange

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by