[/code]"> [/code]"> [/code]">
I've searched on the internet, but I can't figure out what this expression is useful for.
[code]function [val]=f_obiectiv(p) % functia obiectiv din problema celor n regine %{ gradul de "neconformitate" a unei permutari: numarul de pozitii distincte de pe tabla de sah pentru care reginele plasate in acele pozitii sunt in situatie de atac %} [~,n]=size(p); val=0; for i=1:n for j=i+1:n if(abs(i-j)==abs(p(i)-p(j))) val=val+1; end; end; end; % calitatea permutarii: numarul total de perechi de pozitii (regine) posibile - % numarul de perechi "neconforme" val=n*(n-1)/2-val; end[/code]


JLCPCB – Prototype 10 PCBs for $2 (For Any Color)

China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online Orders Daily
How to Get PCB Cash Coupon from JLCPCB: https://bit.ly/2GMCH9w

Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir