필터 지우기
필터 지우기

How to make this?

조회 수: 1 (최근 30일)
Gemalyn Apostol
Gemalyn Apostol 2016년 10월 25일
답변: KSSV 2016년 10월 25일
We create a vector z = ones(1,10);and define some intervals of z to be zero. The intervals are stored in vectors a and b where a contains the start indices and b the end indices of the intervals. With a = [3 8] and b = [5 9] the desired result should be r = [1 1 0 0 0 1 1 0 0 1].How do we make this?

채택된 답변

KSSV
KSSV 2016년 10월 25일
z = ones(1,10);
a = [3 8] ;
b = [5 9] ;
for i = 1:length(a)
z(a(i):b(i)) = 0 ;
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by