First of all I would like to mention that entering the data into Matlab like you indicated:
and i want to read it in matlab like
N1=[A B C];
N2=[D E F];
N3=[G H I];
N4=[J K L];
N5=[M N O];
N6=[A D G H];
N7=[B G J K];
N8=[B J M N];
N9=[A E I O];
N10=[M L F];
N11=[B C E H K];
N12=[E K N];
N13=[F K N];
N14=[C E H];
N15=[H I J M O];
N16=[D H];
N17=[C E];
N18=[I J M N];
N19=[E L];
N20=[H J];
Will result in nothing more than error messages.
The data can be entered as:
Code:
>> N1 = ['A' 'B' 'C']
N1 =
ABC
>> size(N1)
ans =
1 3
OR
Code:
>> N1 = ['A'; 'B'; 'C']
N1 =
A
B
C
>> size(N1)
ans =
3 1
The first results in a 1x3 Array of Characters, the second a 3x1 Array of Characters.
Since, this was not specified I chose the later, I think it is easier to read and should not effect your final application.
I have upoaded the m file, processnetlist.m and the sample data provided by you.
The function can be ran by simply typing
processnetlist in the Matlab command window, a dialog box asking you to select the file to be processed opens. Upon select the netlist file, processnetlist processes the fill displaying each line of the file followed by the display of each array created:
...
.net N9 A E I O
N9 =
A
E
I
O
.net N10 M L F
N10 =
M
L
F
.net N11 B C E H K
N11 =
B
C
E
H
K
...
You can test the results by simply typing in the name of one of the arrays created:
The function should take care of your requirements and can be modified to fit your future needs.
Contact me if you have any questions.