How to use IF with @(block_struct) function
Mostra commenti meno recenti
fun2 = @(block_struct) ...
if block_struct.data < 100
std2(block_struct.data) * (block_struct.data));
end
Doesnt work.
I actually want to manipulate individual elements of my block
blocks made of 8x8 values ranging from 0-255
2 Commenti
Geoff Hayes
il 22 Nov 2020
Saud - can you show us what the block_struct looks like with respect to attributes/properties? Presumably it has a data field. It isn't clear to me why you are doing
fun2 = @(block_struct) ...
where block_struct is the input to some function. Or are you hoping that all of the code
fun2 = @(block_struct) ...
if block_struct.data < 100
std2(block_struct.data) * ones(size(block_struct.data));
end
is an anonymous function? If so, then I don't think that the above is valid...
Saud Alfalasi
il 22 Nov 2020
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Neighborhood and Block Processing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!