0

i have input file like image below and it contains adjacency matrix+ one number in first line. so here is the problem that i cant read file in order to set this information in 2 variable one of them stores line 1 and variable 2 stores adjacency matrix. so what I can do about this??

its necessary to mention that adjacency matrix is not in fixed size! Here is a picture of my question: thnx in advanced :)

enter image description here

3
  • i have 1 unrelated question! is there any implementation of independent sets using genetic algorithm in matlab? i cannot find this implementation ! but in C# and java and... thats there. so i appreciate any kind of help!
    – Arash
    May 24, 2015 at 21:06
  • That should probably be a separate question. Do you mean a heuristic for solving the Maximum Independent Set problem? A search yields this. Does that help?
    – pyrocrasty
    May 24, 2015 at 21:27
  • @pyrocrasty thats good but i need to use genetic algorithm to solve this problem.
    – Arash
    May 25, 2015 at 4:26

1 Answer 1

1
  1. You can read a matrix from a file into a variable with dlmread

    dat = dlmread('filename.ext', ',')
    
  2. You can use indexing to separate the parts:

    x = data(1, 1)
    table = data(2:end, :)
    
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .