我有一个Matlab代码,如下所示:
function IWDalg(similarityMatrix,NumberOfSentencesInFile,NumberOfSentencesInAbstract)
NumIWDs = str2int(NumberOfSentencesInFile);
Numnodes=NumIWDs;
av = 1; bv = 0.01; cv = 1;
as = 1; bs = 0.01; cs = 1;
soil = repmat(InitSoil,Numnodes,Numnodes);
for i =1:NumIWDs
IWD{i}.vel = InitVel;
IWD{i}.tour = [];
IWD{i}.tour(1) =i;
IWD{i}.soil = 0;
end当matlab试图编译的第一行子句时,我得到了以下错误:
??? For colon operator with char operands, first and last operands must be char.我是那么的初学者在matlab编程。
诚挚的问候
发布于 2014-03-31 12:25:45
试试这个。
NumIWDs = str2double(NumberOfSentencesInFile);您应该将char转换为用于冒号执行的double。
https://stackoverflow.com/questions/22760980
复制相似问题