Hi all I have a problem in matlab .
I have a text file in which the data is delimited by spaces. An example is given as follws :
3 4
1 3 6
2 4 5 7
1 3 0
0 0 -1 -2
1 -1 0 -1
-1 0 -2 0
1 -1 2 3 1
What I want to do is to read the text file & generate matrices like this :
size_mat=[3,4];
B=[1,3,6];
NB=[2,4,5,7];
b=[1,3,0];
A=[0, 0, -1, -2;
1, -1, 0, -1;
-1, 0, -2, 0];
z=[1,-1,2,3,1];
%//In details I can highlight these points :
%//1st line is the size_mat matrix. This has always dimension 1X2. m=size_mat(1) & n=size_mat(2)
%//2nd line is the B matrix. Dimension is 1Xm
%//3rd line is the NB matrix Dimension is 1Xn
%//4th line is the b matrix Dimension is 1Xm
%//Starting from 5th line to the (last-1) line is my A matrix
%//whose size is actually equal to mXn where m=size_mat(1) & n=size_mat(2)
%//Last line is the z matrix Dimension is 1X(n+1)
How can I do this matlab ?
Thanks in advance !!
Please do check the edits. Updated the sizes of the matrix to be extracted!