ty for time.. reshape don't work :(
i came up with this...
function [steps]= steps(data,k)
%function [sum_new]= stepsum(data,k)
%input data(:,1)
%output sum of data every k steps
k;
a=data;
idx=[1:length(a)]';
ii=length(a)/k;
sum_new=zeros(ii,1);
mean_new=zeros(ii,1)...
I am trying something but as a noob in MATLAB i am stuck
%a=ones(20,1)
%a=[1 1 1 1 1 2 2 2 2 2]'
idx=[1:size(a)]'
%a1 klimaka
k=5;
a0=0
for idx=[a0+k]
a1=1:k:10
sum_a1=sum(a(1:idx,1))
a1=k-a0
end
for idx=[a1+k]
sum_a2=sum(a(a1+1:idx,1))
a2=a1+k
end...
hello every one.
I want to create a routine in matlab
Let A be a (40,1) matrix.
I want to create a routine that every 10 steps of A will take the sum and place it in a new matrix.
ty