how to get vector from x and y coordinates ?

i have points from minutiae represented as x and y coordinates for termination(end point) and biffurcation(cross section point), for example bifurcation points are :
x: 70 163 167 145 179 142
y : 70 100 20 40 30 20
i set those points as a variable called BifPoint, and try to set them as input for neuron in neural network as data training from 100 images. how to have those coordinates x and y points as vectors so that i can use the vectors as input in neural network for training and then classify them?

 Accepted Answer

To make your x and y into vectors by using valid MATLAB syntax, Replace : with =[ and then close with a right bracket:
x = [70 163 167 145 179 142];
y = [70 100 20 40 30 20];

7 Comments

To use them as inputs for neural networks, you will want to create columns of data, one column per input image. You would concatenate the x and y data together, such as
input_data(:, image_number) = [x(:), y(:)];
how about the target ? is this correct to declare them such as.
target = zeros(1,180);
target(:,1,18) = 1;
target(:,19,36) = 2;
target(:,37,54) = 3;
target(:,55,72) = 4;
target(:,73,91) = 5;
target(:,92,109) = 6;
target(:,110,127) = 7;
target(:,128,145) = 8;
target(:,146,163) = 9;
target(:,164,181) = 10;
1 until 10 is to classify as 10 each different persons.
Note that some NN functions require that the targets be in the form of binary matrices, with the '1' set according to the class number. The function ind2vec() converts to that form.
You would not use
target(:,1,18) = 1;
but rather something like
target(:,1:18) = 1;
Watch out for the fact that you are designating 181 targets in an array sized as 180. Your class 5 has 19 members where the others have 18.
If all of the groups are intended to be 18 then,
target = repmat( 1:10, 1, 18 ) .';
You declare target as a 1-D vector then you try to assign numbers to planes in a 3-D array. So, no, that is not right.
yeahh it is a misstype i know that it should be target(:,1:18) = 1; not target(:,1,18) = 1 and also misstype designating as 180 targets in array sized 180; actually i intended labeling target from 180 images and each one labeled image consist of 18 images. that's why the total is 10 target or class.
Dear image analyst, so what is the right code or way to assigning number point from x and y coordinates that i already have to the plane 3-D array? should i let the input vector into 2-D array and change the plane to be 2-D array ? i dont have any idea and not yet understand enough, please kindly give me your suggestions.
So why declare it at 1-d (1-by-180) and then access it with two indexes? target(:,1:18) means "all rows and columns 1 through 18" but there is only one row because you declared target as zeros(1, 180).
Anyway, you need to look at the function where you intend to send this vector or matrix and see what it expects, and send it that. I don't know neural networks or your particular function so I can't help with that.

Sign in to comment.

More Answers (0)

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!