|
From: William Thielicke on 6 May 2008 08:54 Hello! I have the following problem: I want to extract some numbers from a text file. Please have a look at this image here, I think this makes my question clearer: http://www.villalachouette.de/william/krims/matlabprob.jpg I want to store four columns in "B". I already managed to store column 3 and 4 in B, but I do not manage to store column 1 and 2. E.g. "0042:0041" has to be divided into the integers "41" and "41"... How can I do that....? B.t.w. this is my code to extract column 3 and 4: A=importdata ('2008-05-6_12-44-18_.txt','\t'); A.textdata (1:13,:)=[]; %delete rows 1-13 B=zeros(size(A.textdata,1),4); %prepare empty matrix B(:,3)=str2num(strvcat (A.textdata (:,3))); %U vector B(:,4)=str2num(strvcat (A.textdata (:,4))); %V vector I am sure that this code is far from being optimal, but it works It would be very nice if you could help me with this problem. Best regards, William (veeeeery new to matlab)...
From: William Thielicke on 6 May 2008 09:11 ^^SOLVED^^ sorry, i don't know how to delete my post... for i = 1:size(A.textdata,1); X(i,1)= str2num([pixelpos(i,1) pixelpos(i,2) pixelpos(i,3) pixelpos(i,4)]) Y(i,1)= str2num([pixelpos(i,6) pixelpos(i,7) pixelpos(i,8) pixelpos(i,9)]) end
|
Pages: 1 Prev: Integration inside loop does not work Next: polyfir with constraints |