using matrix as a population in ga function of Matlab [closed] - matlab

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to use genetic algorithm in matlab. I have a matrix as a population.
how can I use a specific matrix as a population to input in ga function of Matlab?

use gaoptimset setting the 'InitialPopulation' field and pass the result to your ga as the options argument
example:
pop = {rand(n,m)} %// The {} might not be necessary.
options = gaoptimset('InitialPopulation',pop);
x = ga(....., options)

Related

how do I enter the coordinates of a point in matlab? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 months ago.
Improve this question
I wan to give x,y,z coordinates to a point, for example to P point.
The P point coordinates are: P=(0,1,1)
How can I give the values in Matlab?
I tried P=(0,1,1) and Px=0 Py=0 Pz=0 ,but I need it to an equation.
one variable can store n-dimensional coordinates
P=[0 1 1];
you can also do this:
px=0;
py=1;
pz=1;

How do you convert a .PNG image to a matrix of values using MATLAB? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Is it possible to convert a .PNG image to an array of numerical values (e.g. red, green, blue values) that I can work with using MATLAB? If so, how can I do this?
not sure what you mean.
if you import imread('someImage.png') you get a n x m x 3matrix

How to calculate the energy of the function tri(2t+5/6) using matlab? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
How to calculate the energy of the function tri(2t+5/6) using matlab?[where tri is triangular pulse function]
Define trisqr square function and integrate over it:
trisqr=#(x) tri(x).*tri(x);
xmin=-2;
xmax=2;
Energy=integral(trisqr,xmin,xmax)

Local minima in Backpropagation algorithm [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
The addition of an extra term, called a proportional factor reduces the convergence of the back propagation algorithm.
So how to avoid local minima in Back propagation algorithm.
In local minimum a gradient of an error function is a zero vector - so backprop - which is using a gradient - cannot move your parameters any further and finishes training.

How can I make aperture function (telescope's aperture) in Matlab? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Can anyone help me to make aperture function in Matlab? I tried by making a matrix, but it wasn't helpful.
If you have the image processing toolbox you can use fspecial:
A = fspecial('disk',10);
This will create an aperture of radius 10 pixels.
Next, you can embed this matrix in a bigger zero matrix, using padarray, for example:
A = padarray(A,[20 20]);