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
1 件のコメント
Fangjun Jiang
2011 年 10 月 23 日
Use {}Code format next time.
回答 (1 件)
Fangjun Jiang
2011 年 10 月 23 日
0 投票
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).
カテゴリ
ヘルプ センター および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!