Closed nguyen-td closed 1 year ago
There is no need for a try, catch clause. You can simply test if length(S.freqs) == 1 Try, catch is only when you do not have the choice.
Otherwise, yes, of course.
Cheers,
Arno
On Jul 27, 2023, at 11:52 PM, Tien Dung Nguyen @.***> wrote:
Hi Arno,
I just saw that the issue wasn't your error message which you fixed in e804f86 but line 340 https://github.com/sccn/roiconnect/blob/1150aa49930847fe9cc129d3905f874cffa5abd4/pop_roi_connectplot.m#L339-L341
If you pass only a single frequency like this pop_roi_connectplot(EEG, 'measure', 'MIM', 'plotcortex', 'off', 'plotmatrix', 'on', 'freqrange', 8); you get an error because g.freqrange has only one entry. I wrote a version for single frequencies elsewhere to do it like this https://github.com/sccn/roiconnect/blob/1150aa49930847fe9cc129d3905f874cffa5abd4/pop_roi_statsplot.m#L45-L52 Let me know if it would be okay to rewrite pop_roi_connectplot this way. I think this should also be compatible with the GUI?
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.
Done in #64
Hi Arno,
I just saw that the issue wasn't your error message which you fixed in e804f86 but line 340 https://github.com/sccn/roiconnect/blob/1150aa49930847fe9cc129d3905f874cffa5abd4/pop_roi_connectplot.m#L339-L341
If you pass only a single frequency like this
pop_roi_connectplot(EEG, 'measure', 'MIM', 'plotcortex', 'off', 'plotmatrix', 'on', 'freqrange', 8);
you get an error because g.freqrange has only one entry. I wrote a version for single frequencies elsewhere to do it like this https://github.com/sccn/roiconnect/blob/1150aa49930847fe9cc129d3905f874cffa5abd4/pop_roi_statsplot.m#L45-L52 Let me know if it would be okay to rewritepop_roi_connectplot
this way. Not sure if a try-catch is super clean though. I think this should also be compatible with the GUI?