MATLAB: To display current time along side each element of a vector . need to implement it in the program below.

timestamp

x=[];
fprintf('Enter the size of array');
n=input('');
for i=1:n
r=rand;
x(i)=r;
end
disp(x);

Best Answer

If you want to store your data in an array where each data point has a time and date associated with it, use a timetable.
Related Question