how to use this symbol in matlab?? ±

3 次查看(过去 30 天)
I have a if loop where i need to check the condition.The loop is something like this:
if(tht(1)==thf(1))
S='Orginal Note';
disp(S);
else
S = 'Fake Note';
disp(S);
end
Inside that if loop i want to place that ±. How can i do this?? For example like:
if(tht(10)==thf(10±5))
How it can be done??

采纳的回答

James Tursa
James Tursa 2015-6-2
Did you mean a simple test for two different values?
if( tht(10)==thf(10-5) || tht(10)==thf(10+5) )
  2 个评论
B.k Sumedha
B.k Sumedha 2015-6-2
Cant it be used in just one situation both together.
James Tursa
James Tursa 2015-6-2
If you are asking if ± is an allowed operator in MATLAB, the answer is no.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by