So i have a vector of [1x2e6] of frequency data , so I would like to create a loop so that it stores 10 0.1ms (millisecond) this frequency data and fprint it.

1 view (last 30 days)
%initialization
fc=2e6;
samplerate=50;

Answers (1)

Walter Roberson
Walter Roberson on 19 May 2022
Number_per_group = 10;
in_groups = buffer(YourSignal, Number_per_group);
fmt = [repmat('%8.5f ', 1, Number_per_group - 1), '%8.5f\n'];
for K = 1 : size(in_groups, 2)
fprintf(fmt, in_groups(:,K));
end

Categories

Find more on Problem-Based Optimization Setup in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!