Conversion to double from cell problem

I need help! I am using the code below to insert values from a text file. The values for this particular part of the text file contain, numbers and string characters. I keep getting a conversion to double from cell not possible error. Thank you,
nodalfix=lineNL-lineNF-1;
for j=1:nodalfix
NFIX = textscan(nf{j,:}, '%f %s %s %f %f', 'delimiter', ',','EmptyValue',-Inf);
NF(j,1) = NFIX{1};
NF(j,2) = NFIX{2};
NF(j,3) = NFIX{3};
NF(j,4) = NFIX{4};
NF(j,5) = NFIX{5};
end

Risposte (1)

Fangjun Jiang
Fangjun Jiang il 23 Ott 2011

0 voti

What is nf{j,:}? If it is the first argument of textscan(), it should be a file Id or text string. That causes the error message. It tries to convert nf{j,:} (which is a cell) to a double (expected file Id).

Categorie

Scopri di più su Get Started with MATLAB in Centro assistenza e File Exchange

Tag

Richiesto:

il 23 Ott 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by