Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Thread Subject:
Help needed for code in matlab

Subject: Help needed for code in matlab

From: Savdulla

Date: 23 Nov, 2012 23:35:08

Message: 1 of 1

I have a m-file (File 1) in matlab that generates me two vectors Sx = [a1 a2 a3] and Sy = [b1 b2 b3].
I have another m-file (File 2) with genetic algorithm code in it that generates X1 and X2 for minimum solution of a function to be minimized. The function to be minimized is in another m-file (Fle 3) that calculates the distance D = Sum (1/ sqrt[ (X1 - a1)^2 + (X2 - b1)^2] + sqrt[ (X1 - a2)^2 + (X2 - b2)^2] +sqrt[ (X1 - a3)^2 + (X2 - b3)^2]).

I would like to make it a general, to be user decision on the size of the vectors Sx and Sy. Ideally would be to run the genetic algorithm file few times to get different solutions.

Anybody can help with the code will be greatly appreciated.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us