Info
此问题已关闭。 请重新打开它进行编辑或回答。
way to use returned valued of a if clause
1 次查看(过去 30 天)
显示 更早的评论
I have an if clause
if expression
do-something
end
I would use the value return by
expression
into the if clause. Does it exist a way to do this?
2 个评论
回答(1 个)
José-Luis
2012-11-9
I assume you mean something like, in C/C++ style
if (++i == some_value){
//do something with the new value of i
}
Then, no, I don't think you can do that.
But you can always do
your_val = expression
if your_val == something %some condition
%some operation on your_val
end
1 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!