Undefined function 'fieldnames' for input arguments of type 'double' on macOS Sierra

129 views
Skip to first unread message

Andrea Cogliati

unread,
Jul 7, 2017, 11:52:33 AM7/7/17
to ecg-kit users
I tried to install ecg-kit, but I get some errors when running the examples script. I'm running Matlab R2016b on macOS Sierra. Here's the full installation output log, and the log for the examples script:

>> InstallECGkit
Adding paths
Warning: Function newline has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.
> In path (line 109)
 
In addpath (line 88)
 
In InstallECGkit>@(a)(addpath(a)) (line 68)
 
In InstallECGkit (line 68)
Warning: Function newline has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.
> In path (line 109)
 
In addpath (line 88)
 
In InstallECGkit>@(a)(addpath(a)) (line 68)
 
In InstallECGkit (line 68)
Warning: Function newline has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.
> In path (line 109)
 
In addpath (line 88)
 
In InstallECGkit>@(a)(addpath(a)) (line 68)
 
In InstallECGkit (line 68)
Warning: Function newline has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.
> In path (line 109)
 
In addpath (line 88)
 
In InstallECGkit>@(a)(addpath(a)) (line 68)
 
In InstallECGkit (line 68)


############################
# No admin/root privileges #
############################


To install tab-completion feature with the ecg-kit, it is suggested to run this script with administrator/root privileges.
Run Matlab as administrator or answer "YES" when the system asks for permission. Otherwise, tab completion will not be available.


Checking for updates
Compiling sources
Building with 'Xcode with Clang'.
MEX completed successfully
.
Building with 'Xcode with Clang'.
/Users/andreac/Documents/MATLAB/ecg-kit-0.1.6/common/readannot.c:209:21: warning: expression result unused [-Wunused-value]
                    aux
;
                   
^~~
1 warning generated.


MEX completed successfully
.
Building with 'Xcode with Clang'.
MEX completed successfully
.
Installing tab-completion feature.
done !


###############################################
# ecg-kit for Matlab v0.1.6 beta - 03/14/2016 #
###############################################


ecg
-kit was correctly installed.


You can start reading the documentation, or if you prefer, trying these examples.
Go to the forum if you need help.
>> cd examples
>> examples


Description of the process:
 
+ Recording: /Users/andreac/Documents/MATLAB/ecg-kit-0.1.6/recordings/208.dat
 
+ Task name: QRS_detection                                                  


Processing QRS detector gqrs


##########################################
# Could not execute "gqrs" QRS detector. #
##########################################




Undefined function 'fieldnames' for input arguments of type 'double'.


Error in getAnnNames (line 32)
   
for fname = rowvec(fieldnames(aux_struct))




Error in calculateSeriesQuality (line 40)
   
[AnnNames, all_annotations] = getAnnNames(payload_out);




Error in ECGtask_QRS_detection/Process (line 559)
            payload_out
= calculateSeriesQuality(payload_out, ECG_header, [1 ECG_header.nsamp] + ECG_start_offset - 1 );




Error in ECGwrapper/Run (line 682)
                            payload
= obj.ECGtaskHandle.Process(ECG, this_iter_ECG_start_idx, this_iter_ECG_relative_start_end_idx, this_header, this_ann, [this_iter_QRS_start_idx this_iter_QRS_end_idx] );




Error in examples (line 144)
            ECG_w
.Run;


cd
/private/tmp/;gqrs -h: Aborted


Description of the process:
 
+ Recording: /Users/andreac/Documents/MATLAB/ecg-kit-0.1.6/recordings/800.dat
 
+ Task name: QRS_detection                                                  


Processing QRS detector gqrs


##########################################
# Could not execute "gqrs" QRS detector. #
##########################################




Undefined function 'fieldnames' for input arguments of type 'double'.


Error in getAnnNames (line 32)
   
for fname = rowvec(fieldnames(aux_struct))




Error in calculateSeriesQuality (line 40)
   
[AnnNames, all_annotations] = getAnnNames(payload_out);




Error in ECGtask_QRS_detection/Process (line 559)
            payload_out
= calculateSeriesQuality(payload_out, ECG_header, [1 ECG_header.nsamp] + ECG_start_offset - 1 );




Error in ECGwrapper/Run (line 682)
                            payload
= obj.ECGtaskHandle.Process(ECG, this_iter_ECG_start_idx, this_iter_ECG_relative_start_end_idx, this_header, this_ann, [this_iter_QRS_start_idx this_iter_QRS_end_idx] );




Error in examples (line 144)
            ECG_w
.Run;


cd
/private/tmp/;gqrs -h: Aborted


Description of the process:
 
+ Recording: /Users/andreac/Documents/MATLAB/ecg-kit-0.1.6/recordings/example_recording.mat
 
+ Task name: QRS_detection                                                                


Processing QRS detector gqrs


##########################################
# Could not execute "gqrs" QRS detector. #
##########################################




Undefined function 'fieldnames' for input arguments of type 'double'.


Error in getAnnNames (line 32)
   
for fname = rowvec(fieldnames(aux_struct))




Error in calculateSeriesQuality (line 40)
   
[AnnNames, all_annotations] = getAnnNames(payload_out);




Error in ECGtask_QRS_detection/Process (line 559)
            payload_out
= calculateSeriesQuality(payload_out, ECG_header, [1 ECG_header.nsamp] + ECG_start_offset - 1 );




Error in ECGwrapper/Run (line 682)
                            payload
= obj.ECGtaskHandle.Process(ECG, this_iter_ECG_start_idx, this_iter_ECG_relative_start_end_idx, this_header, this_ann, [this_iter_QRS_start_idx this_iter_QRS_end_idx] );




Error in examples (line 144)
            ECG_w
.Run;


cd
/private/tmp/;gqrs -h: Aborted
>>

Mariano Llamedo Soria

unread,
Jul 7, 2017, 1:25:13 PM7/7/17
to Andrea Cogliati, ecg-kit users
Dear Andrea, thanks for reporting !

I can not reproduce your Mac environment, but maybe you can help me to trace where the problem is. Can you find the problem that raise the message

##########################################
# Could not execute "gqrs" QRS detector. #
##########################################

 these should not happen in that example.

Thanks !
Mariano.


--
You received this message because you are subscribed to the Google Groups "ecg-kit users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ecg-kit-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ecg-kit-users/8ca1ae3e-a288-47c7-a1a1-bc0a76cf7d62%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrea Cogliati

unread,
Jul 7, 2017, 2:35:35 PM7/7/17
to ecg-kit users, andrea....@gmail.com
Mariano,

thanks for your help.

I'm not sure what the problem is, but if I trace through the examples script, when the execution enters the function getAnnNames, the parameter aux_struct is empty [], so fieldnames returns an error. Please let me know if you need more information.

Andrea


To unsubscribe from this group and stop receiving emails from it, send an email to ecg-kit-user...@googlegroups.com.

Mariano Llamedo Soria

unread,
Jul 7, 2017, 2:56:44 PM7/7/17
to Andrea Cogliati, ecg-kit users
Dear Andrea try the following:

edit ecg-kit/common/ECGtask_QRS_detection.m

find this code:

                        if( status ~= 0 )
                            disp_string_framed(2, sprintf('Could not execute "%s" QRS detector.', this_detector));  
                        else

put a breakpoint there and find out why this system call

                        [status, ~] = system([ obj.WFDB_cmd_prefix_str  this_detector ' -h' ]);

is failing. Maybe the WFDB lib is not compatible with you MAC, as I told you, I dont use Mac and I can not trace the problem myself.

Hope you can fix it, best,

Mariano.


To unsubscribe from this group and stop receiving emails from it, send an email to ecg-kit-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ecg-kit-users/48df919e-204b-46fa-a74d-ab7e627e19a3%40googlegroups.com.

Andrea Cogliati

unread,
Jul 7, 2017, 3:55:55 PM7/7/17
to ecg-kit users, andrea....@gmail.com
Mariano,

ok, here's the problem:

K>> system([ obj.WFDB_cmd_prefix_str  this_detector ' -h' ]);
dyld: Library not loaded: /Users/mariano/wfdb//lib/libwfdb.10.dylib
  Referenced from: /Users/andreac/Documents/MATLAB/ecg-kit-0.1.6/common/wfdb/macosx-x86_64/bin/gqrs
  Reason: image not found
/bin/bash: line 1: 55463 Abort trap: 6           gqrs -h
cd /private/tmp/;gqrs -h: Aborted

It looks like that your home folder is hardcoded somewhere.

Andrea

Mariano Llamedo Soria

unread,
Jul 7, 2017, 4:18:45 PM7/7/17
to Andrea Cogliati, ecg-kit users
Great Andrea ! I think that the problem was caused when I compiled this library in an emulated MAC, If you can recompile this WFDB library by yourself and replace it, you would be able to use the WFDB software included in the kit. Otherwise you will only have access to the Matlab native functionalities (which are the majority). I encourage you to recompile it, and in case you could make it path independent, I would appreciate that you could share it with the rest of the community.

Best,
Mariano.

To unsubscribe from this group and stop receiving emails from it, send an email to ecg-kit-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ecg-kit-users/f1f733ce-b433-4778-b31f-74aa0a669261%40googlegroups.com.

Andrea Cogliati

unread,
Jul 20, 2017, 1:57:27 PM7/20/17
to ecg-kit users, andrea....@gmail.com
Mariano,

recompiling the WFDB library did the trick. I had a few issues with it, as Anaconda interferes with the make process. However, I was able to compile WFDB by removing all the non-standard folders in my PATH, leaving only the default ones (including Xcode).

Thanks,

Andrea

Mariano Llamedo Soria

unread,
Jul 20, 2017, 4:07:26 PM7/20/17
to Andrea Cogliati, ecg-kit users
Many thanks for sharing Andrea.

Happy to hear good news.
Mariano.

To unsubscribe from this group and stop receiving emails from it, send an email to ecg-kit-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ecg-kit-users/6ceb5602-3cc8-407a-8650-99fc55401249%40googlegroups.com.

alexn...@gmail.com

unread,
Jul 12, 2018, 7:33:19 PM7/12/18
to ecg-kit users
Hello, I am also experiencing this same issue. Could you please help me with the steps to recompile the WFDB library and replace it?
Thanks,
Alex

Mariano Llamedo Soria

unread,
Jul 13, 2018, 10:46:03 PM7/13/18
to alexn...@gmail.com, ecg-kit users
Hello Alex, I have never did that, but here you have help. Probably many people here in the forum or in Physionet may help you. This guy Andrea found the problem but never reported sucess. If you succed in doing that, please report it here. I can put that in the documentation in that case for MAC users.


Best,
Mariano.

Reply all
Reply to author
Forward
0 new messages