my code stock.com

muhlisoz

ManupleEdilmisElemanlariFarkliDizi
by muhlisoz

TSP ile Zaman Pencereleri probleminin çözümü için geli

Snippet options

Download: Download snippet as manupleedilmiselemanlarifarklidizi.txt.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

function dizi=manupleelemanlarifarkli(diziboyutu,altlimit,ustlimit)
dizi=[];
birincidizi=[];
ikincidizi=[];
if mod(ustlimit,2)==1
    a=(ustlimit+1)/2;
else
    a=ustlimit/2;
end
birincialtlimit=altlimit;
birinciustlimit=a;
ikincialtlimit=birinciustlimit+1;
ikinciustlimit=ustlimit;
if (diziboyutu>=1)&&(diziboyutu<=(ustlimit-altlimit+1))
    for i=birincialtlimit:birinciustlimit
        rastgelesayi=round(birincialtlimit+(birinciustlimit-birincialtlimit)*rand(1));
        while icindemevcutmu(birincidizi,rastgelesayi)
            rastgelesayi=round(birincialtlimit+(birinciustlimit-birincialtlimit)*rand(1));
        end
        birincidizi(i-1)=rastgelesayi;
    end
    for j=ikincialtlimit:ikinciustlimit
        rastgelesayi=round(ikincialtlimit+(ikinciustlimit-ikincialtlimit)*rand(1));
        while icindemevcutmu(ikincidizi,rastgelesayi)
            rastgelesayi=round(ikincialtlimit+(ikinciustlimit-ikincialtlimit)*rand(1));
        end
        ikincidizi(j-a)=rastgelesayi;
    end
    dizi=[birincidizi ikincidizi];
end

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.