Apply a threshold on a structure

Hi, I have 3 components which are struct type and I would like to apply a threshold using wthresh. My problem is that wthresh function doesn't accept a struct in input parameter. How can I do that ? Thanks for your answers

1 Kommentar

Guillaume
Guillaume am 7 Jun. 2016
A structure is simply a container for several variables (the fields of the structure). 'Thresholding a structure' does not mean anything. So, you need to be clearer about what you want to do.
You may want to threshold all the fields of the structure, or just one (which one?).

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 6 Jun. 2016

0 Stimmen

structfun(), probably with 'Uniform', 0

2 Kommentare

I don't really understand how structfun() works. I have my Component which is a struct, I do
structfun(wthresh(Component1,'s',T),'UniformOutpout',false);
But it always the same problem, "Undefined function 'abs' for input arguments of type 'struct'." Thanks for your answer
structfun(@(field) wthresh(field, 's', T), Component1, 'Uniform', 0)

Melden Sie sich an, um zu kommentieren.

Gefragt:

am 6 Jun. 2016

Kommentiert:

am 7 Jun. 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by