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
Fangjun Jiang 2011 年 10 月 23 日
Use {}Code format next time.

サインインしてコメントする。

回答 (1 件)

Fangjun Jiang
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 ExchangeGet Started with MATLAB についてさらに検索

タグ

質問済み:

2011 年 10 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by