Effacer les filtres
Effacer les filtres

Understanding the if command

2 vues (au cours des 30 derniers jours)
Nikolaos Zafirakis
Nikolaos Zafirakis le 14 Juil 2019
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)

Réponse acceptée

KALYAN ACHARJYA
KALYAN ACHARJYA le 14 Juil 2019
Modifié(e) : KALYAN ACHARJYA le 14 Juil 2019
elseif isempty(c1)
o(c(1)+1:end)=o(c(1)+1:end)-2^16;
else
%do nothing
end

Plus de réponses (0)

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by