Understanding the if command

조회 수: 2 (최근 30일)
Nikolaos Zafirakis
Nikolaos Zafirakis 2019년 7월 14일
편집: KALYAN ACHARJYA 2019년 7월 14일
o = B(1:50,2);
a1 = diff(o);
[c1,d1] = find(a1>2^15);
[e1,f1] = find(a1<-2^15);
if c1 > 0;
o(c1+1:e1) = o(c1+1:e1)-2^16;
elseif c1 < 0;
o(c1+1:e1) = o(c1+1:e1)+2^16; % works good
else ; % Basically I need the command to say when e1 = isempty to use the statement below!
o(c(1)+1:end) = o(c(1)+1:end)-2^16;
end
plot(o)

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2019년 7월 14일
편집: KALYAN ACHARJYA 2019년 7월 14일
elseif isempty(c1)
o(c(1)+1:end)=o(c(1)+1:end)-2^16;
else
%do nothing
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by