1 view (last 30 days)

Dear

I am facing problem in below program.....

buttLoop3 is data signal having 30000x4 values

I want to find zero crossing on buttLoop3 in such a way that ti(k) return values of four different signal crossing zero value in 4 columns.....

for i = 1:4

y(i) = buttLoop3(:,i) ; % filtered signal 7:05pm 31-7-19

zci = @(v) find(v(:).*circshift(v(:), [-1 0]) <= 0); % Returns Approximate Zero-Crossing Indices Of Argument Vector

xi = zci(y(i) ); % zero crossing indices command

for k = 1:numel(xi)-1

ti(k) = interp1(y(i)([xi(k) xi(k)+1]), t([xi(k) xi(k)+1]), 0); % Interpolate To Find ‘t’ At ‘y=0 ’

end

end

Opportunities for recent engineering grads.

Apply Today
## 8 Comments

## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/474378-facing-problem-in-loop#comment_730530

⋮## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/474378-facing-problem-in-loop#comment_730530

## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/474378-facing-problem-in-loop#comment_730606

⋮## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/474378-facing-problem-in-loop#comment_730606

## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/474378-facing-problem-in-loop#comment_730699

⋮## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/474378-facing-problem-in-loop#comment_730699

## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/474378-facing-problem-in-loop#comment_730711

⋮## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/474378-facing-problem-in-loop#comment_730711

## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/474378-facing-problem-in-loop#comment_730737

⋮## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/474378-facing-problem-in-loop#comment_730737

## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/474378-facing-problem-in-loop#comment_730748

⋮## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/474378-facing-problem-in-loop#comment_730748

## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/474378-facing-problem-in-loop#comment_730756

⋮## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/474378-facing-problem-in-loop#comment_730756

## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/474378-facing-problem-in-loop#comment_730771

⋮## Direct link to this comment

https://se.mathworks.com/matlabcentral/answers/474378-facing-problem-in-loop#comment_730771

Sign in to comment.