I need some help. Basically, I have a large dataset that I have split into blocks, now, I need to print the blocks individually instead of printing the whole entire block.
Here is my code:
function f = printData()
data('FILE_NAME');
blockeddata = blocks(data, 600, 200);
f = blockeddata;
end
I just need to print each block separately. Ideas anyone?
Here’s the function:
function f = blocks(v, N, M)
n = length(v);
maxblockstart = n - N + 1;
lastblockstart = maxblockstart - mod(maxblockstart-1 , M);
% numblocks = (lastblockstart-1)/M + 1
numblocks = (lastblockstart-1)/M + 1;
%f = zeros(numblocks,N);
for i = 1:numblocks
for j = 1:N
f(i,j) = v((i-1)*M+j);
end
end
Not sure if I understand the problem, but how about sending N and M to print()? From the quick looks of it, you already have the functionality. You just need to modify your print function to take N and M.
So basically, add N and M to print() and change 600 and 200 to N and M respectively. Then call print with 600 and 200 (or whatever you like) as your input.
Hope it helped 😀