Recent content by kickapoo
-
K
MATLAB How to Create a Routine in Matlab for Summing Every 10 Steps of a Matrix?
ty both for your time .. you really help me a lot ...- kickapoo
- Post #10
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
K
MATLAB How to Create a Routine in Matlab for Summing Every 10 Steps of a Matrix?
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)...- kickapoo
- Post #5
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
K
MATLAB How to Create a Routine in Matlab for Summing Every 10 Steps of a Matrix?
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...- kickapoo
- Post #3
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
K
MATLAB How to Create a Routine in Matlab for Summing Every 10 Steps of a Matrix?
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- kickapoo
- Thread
- Code Matlab
- Replies: 11
- Forum: MATLAB, Maple, Mathematica, LaTeX