Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Code for Monotonically increasing function

1 Ansicht (letzte 30 Tage)
Swati Sarangi
Swati Sarangi am 19 Nov. 2020
Geschlossen: Stephen23 am 19 Nov. 2020
Hi All,
Can anyone check the following code snippet and tell me why it fails for the following test cases?
x = cumsum(rand(1,100));
x= [ -3 -2 -1 0 1 2 3]
function tf = mono_increase(x)
for ii=1:length(x)
for jj=(ii+1):length(x)
if x(ii)<x(jj)
tf = true;
else
tf = false;
end
end
end
end
I'm getting the desired result in my laptop but with the compiler of MATLAB , I'm getting error.
Please someone tell me how to resolve it.

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by