我有一個MATLAB布爾運算符的問題。matlab布爾運算符
非ASCII範圍:
- 0 - 2
- 以上128
if條件變爲真僅當有在上述範圍內沒有字符。條件似乎是假所有的時間 -
if any(out.autoc < 128 & out.autoc > 2 & ...
out.cprom < 128 & out.cprom > 2)
fprintf(file_1, '%s,' , out.autoc);
fprintf(file_1, '%s,' , out.cprom);
fprintf(file_1, '\r\n');
else
display(fileName);
end
預期它不工作:
if any(out.autoc < 128 & out.autoc ~= 0 & out.autoc ~= 1 & ...
out.cprom < 128 & out.cprom ~= 0 & out.cprom ~= 1)
fprintf(file_1, '%s,' , out.autoc);
fprintf(file_1, '%s,' , out.cprom);
fprintf(file_1, '\r\n');
else
display(fileName);
end
的問題,當我執行下面出現。爲什麼?
你能提供一些我們可以用來測試它的代碼嗎?由ascii範圍 – Superbest 2012-04-27 08:07:26