Increase lengthof variable in a for loop by a certain increment.
조회 수: 3 (최근 30일)
이전 댓글 표시
hello I have a for loop and wish to increase the length of my start variable by an increment value that i can later choose. It is basically crea ting the attenuation of a pulse train without using the pulstran function. this is how far I have got, but I either have to preallocate a variable which I've done or I'm iout of memory.
Nclick=10 %number of clicks;
start=((1:Nclick)*60e-3)/(1/fs); % defines a vector of start positions
y3=zeros(1,length(twin));
for ii=1:length(start);
length(start)= length(start)*0.5;
y3(start3(ii):start3(ii)+length(y2)-1)=y2;
end;
댓글 수: 0
답변 (1개)
Oleg Komarov
2011년 4월 9일
Don't use length as a variable:
length(start)= length(start)*0.5;
You're creating length as a variable which obfuscates the function.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!