lostanlen / scattering.m

Scattering.m — a MATLAB toolbox for wavelet scattering
MIT License
56 stars 11 forks source link

example_handel.m fails to plot scattergram #35

Closed jfsantos closed 8 years ago

jfsantos commented 8 years ago

example_handel.m is currently breaking at line 31:

>> example_handel
Index exceeds matrix dimensions.

Error in example_handel (line 31)
scattergram = U{1+2}.data{modulation_scale_index}.';

modulation_scale_index is 8, but data has only 4 elements. Also, data is a 3D array, so the transpose operator is not defined.

lostanlen commented 8 years ago

Hi, Yes, I have noticed the issue today. One must call U = sc_unchunk{U} in order to collapse the first two dimensions (time withing chunk and chunk index) into one time dimension. The fact that data has only 4 elements may be a mistake in bandwidth inequality. Will keep you in touch.

lostanlen commented 8 years ago

I think the inequality was correct. The issue should be fixed after PR #34. Thank you @jfsantos for your interest.

jfsantos commented 8 years ago

It works now, thanks! Just a small nitpick: line 35 plots the scattergram over the scalogram, so maybe it would be better to create a new figure before calling imagesc. It's also not clear why you call display_scalogram twice, the second time after some simple variable manipulation. I guess it's probably there for debugging reasons.

lostanlen commented 8 years ago

Both remarks are right. Commits 2a77296 and aec2c51 on latest master address them. I have put the two figures as vertical subplots.

jfsantos commented 8 years ago

That was quick, thanks!