Hi Saud,
Since blockproc uses anonymous functions, you may save your multi-line function into a script, say myFunc.m and then pass @myFunc to your blockproc call.
You may work out a way to manage the sequence artificially using some of those fields. For example, using block_struct.location to skip processing the 2nd block:
function out = myFunc(block_struct)
if(block_struct.location(2)==101)
out = block_struct.data;
else
end
end
Hope it helps!
2 Comments
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/656433-how-to-use-if-with-block_struct-function#comment_1151898
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/656433-how-to-use-if-with-block_struct-function#comment_1151898
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/656433-how-to-use-if-with-block_struct-function#comment_1151948
Direct link to this comment
https://fr.mathworks.com/matlabcentral/answers/656433-how-to-use-if-with-block_struct-function#comment_1151948
Sign in to comment.