way to use returned valued of a if clause
Info
This question is closed. Reopen it to edit or answer.
Show older comments
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 Comments
Azzi Abdelmalek
on 9 Nov 2012
what do you mean, give an example
Salvatore Mazzarino
on 9 Nov 2012
Edited: Salvatore Mazzarino
on 9 Nov 2012
Answers (1)
José-Luis
on 9 Nov 2012
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 Comment
Salvatore Mazzarino
on 9 Nov 2012
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!