function [n_prn]=findPRN(SATXYZ2A) SAT=[SATXYZ2A(:,[12:221])]; [Row,Col] = size(SAT);%Eliminate data which is not GPS
for i = 1:10:Col String_temp = (SAT{1,i}); if not(strcmp(String_temp,'GPS')) break; endend SAT = [SAT(:,[1:i-1])]; A = dataset2cell (SAT); A(1,:)=[]; [Row,Col] = size(A); B=[A(1,[2:10:Col])]; [Row,Col] = size(B); for j=1:Col if ischar(B{j}) B(j)= str2num(B(j)); end end B = cell2mat(B); n_prn=transpose(B);end
MATLAB: Trying to convert string to number but the last number is not converting. What am I doing wrong in the code? The problem is B(j)=str2num(B(j)) row.
nb
Best Answer