How to add a timestamp to array in simulink?
Show older comments
Hello,
I have problem with adding a timestamp in simulink. I have array date (9 values) from IMU sensor like on the picture and I need to add a tenth kolumn with timestamp (with milisecond).

I have tried like on the picture below with code in matlab function:
function [Y, M, D, H, MN, S, MS] = fcn()
eml.extrinsic('now');
eml.extrinsic('datevec');
Y = 0;
M = 0;
D = 0;
H = 0;
MN = 0;
S = 0;
MS = 0;
[Y, M, D, H, MN, S, MS] = datevec(now);
end

And to create a file with txt format I used a command:
dlmwrite('E:\temp.txt', sumout111,'delimiter','\t','precision',3)
When I run simulation I have error:

Ok, I have changed directory and ran as admin Matlab and I have another problem:

%
Accepted Answer
More Answers (1)
Categories
Find more on Programmatic Model Editing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!