Exporting Simulink Scope Results to Excel

Hi, I am trying to export Simulink Scope Results to Excel. The simulation time is 0.3 seconds but the Excel file only shows up to 0.1 seconds. Any ideas?

 Accepted Answer

Did you remove the tick mark from Limit data points to last: 5000

6 Comments

Yes I did, this is how it looks like:
I am using the online 30 day trial version FYI
The question is how did you import the stored data in MATLAB workspace into MS Excel.
Here is one example from your showed screenshot how export the stored data from MATLAB into MS Excel.
Data = out.ScopeData1.signals.values;
Time = out.ScopeData1.time;
plot(Time, Data)
%% Way 1: writematrix()
% Way 1: Write the collected time and data matrix
writematrix([Time, Data], "MS_Excel.xlsx");
% Check:
winopen("MS_Excel.xlsx")
%% Way 2: use writetable()
% Create a table array from the collected time and data matrix
D_Table=array2table([Time, Data]);
% Way 2: Write the table array
D_Table = renamevars(D_Table, ["Var1", "Var2"], {'Time', 'Data'});
writetable(D_Table, "MS_Excel2.xlsx");
% Check:
winopen("MS_Excel2.xlsx")
Thanks, let me try it...........
You are a genius, it works like a charm!!!!!!!!!!!!!!!! Thanks a lot, I really appreciate it!!!!!!
Awesome :) . Most welcome! Glad I could help. Please click "thumbs UP" vote :)
All the best!

Sign in to comment.

More Answers (0)

Products

Release

R2023b

Community Treasure Hunt

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

Start Hunting!