Conversion to double from cell problem
Show older comments
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
1 Comment
Fangjun Jiang
on 23 Oct 2011
Use {}Code format next time.
Answers (1)
Fangjun Jiang
on 23 Oct 2011
0 votes
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).
Categories
Find more on Get Started with MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!