what's wrong with this "IF" in the code below?

조회 수: 1 (최근 30일)
Ehsan Ben
Ehsan Ben 2021년 5월 14일
댓글: per isakson 2021년 5월 14일
Hello,
I have the code below and want to define a conditional IF command in a For loop. force100 is a cell variable. But I get the following error:
Error: File: ppmicro.m Line: 349 Column: 17
Invalid text character. Check for unsupported symbol, invisible character, or pasting of non-ASCII
characters.
This is the code which is part of a bigger code:
sc100 = [];
wc100 = [];
for s = 1 : numFiles100
nc = noc100{s,1}(1,2);
sn100 = 0; % strong counter
wn100 = 0; % weak counter
for k = 1 : nc
if force100{s,1}(1,k) >= ّF100
sn100 = sn100 + 1;
sc100(sn100) = k;
else
wn100 = wn100 + 1;
wc100(wn100) = k;
end
end
end
  댓글 수: 1
Ehsan Ben
Ehsan Ben 2021년 5월 14일
It had a problem in typing. there was an invisible character. It's solved. thanks

댓글을 달려면 로그인하십시오.

답변 (1개)

per isakson
per isakson 2021년 5월 14일
편집: per isakson 2021년 5월 14일
Cannot tell based on the info of your question. Show full error message.
Set Pause on Errors
Run the code. Execution will halt at Line: 349 and show K>> in the Command Window.
Try to spot the offending character
  • is nc = noc100{s,1}(1,2); the offending statement? (I'm guessing)
  • try K>> double( char( noc100{s,1}(1,2) ) ). Does it show any suspicious "ascii-numbers"?
  댓글 수: 2
Ehsan Ben
Ehsan Ben 2021년 5월 14일
It had a problem in typing. there was an invisible character. It's solved. thanks
per isakson
per isakson 2021년 5월 14일
Didn't the code analyzer spot and indicate that error?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by