wfdb-app-toolbox icon indicating copy to clipboard operation
wfdb-app-toolbox copied to clipboard

mat2wfdb cannot be used with arbitrary number of input

Open GoogleCodeExporter opened this issue 9 years ago • 1 comments

mat2wfdb --> cannot be used with arbitrary number of inputs, only two inputs 
are mandatory, but the others have to be provided as empty variables, or 
param_offset=nargin-length(params)+1 will output a negative number, which has 
to be used in a for loop later.



should be fixed with using varargin

Original issue reported on code.google.com by [email protected] on 24 Jan 2014 at 4:22

GoogleCodeExporter avatar Mar 13 '15 23:03 GoogleCodeExporter

%For example running the demo:
clear all;clc;close all
N=1024;
Fs=48000;
tm=[0:1/Fs:(N-1)/Fs]';
adu='V/mV/V';
info='Example 1';
sig1=double(int16(linspace(-2^15,2^15,N)'));
sig2=double(int8(sin(2*pi*tm*1000).*(2^7)))./(2^7);
sig3=(rand(N,1) > 0.97)*2 -1 + 2^16;
sig=[sig1 sig2 sig3];
mat2wfdb(sig,'Ex1',Fs,[],adu,info)

%Works, but this wont:

>> mat2wfdb(sig,'Ex1',Fs)
Undefined function 'regexp' for input arguments of type 'double'.

Error in mat2wfdb (line 129)
adu=regexp(adu,'/','split');


Original comment by [email protected] on 24 Jan 2014 at 10:26

GoogleCodeExporter avatar Mar 13 '15 23:03 GoogleCodeExporter