Problem entering an if-sentence with a "~="-statement
1 次查看(过去 30 天)
显示 更早的评论
I have these two matrices.
RowAndColumn =
2 1
3 1
3 2
RowAndColumnCheck =
3 2
3 1
and i want to use the following if-sentence as an example for my problem:
if RowAndColumn(1,1:2) ~= RowAndColumnCheck(2,1:2)
blablabla
end
The problem seems to be the fact that RowAndColumn(1,2) and RowAndColumnCheck(2,2) is the same, and the function won't enter the if-sentence.
How can i fix this problem? I want to enter the sentence because [2,1] is not the same as [3,1] in total :)
Best Regard HJV
0 个评论
采纳的回答
Wayne King
2013-12-31
编辑:Wayne King
2013-12-31
How about just using isequal()
if ~isequal(RowAndColumn(1,:),RowAndColumnCheck(2,:))
disp('blabla');
end
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!