function [] = dec2hex_file(input, row,N, file_path)
%input : 输入数据(复数)
%row :输入数据长度
%N :实部虚部的位宽
%file_path :输出数据的保存路径
for i=1:row
a(i) = real(input(i));
b(i) = imag(input(i));
if a(i) <0
a(i) = a(i) + 2^N ; %65536;
end
if b(i) <0
b(i) = b(i) + 2^N ; %65536;
end
end
aa=dec2hex(a);
bb=dec2hex(b);
m=[aa bb];
%dlmwrite(file_path, m,'delimiter','', 'newline','pc','-append');
dlmwrite(file_path, m,'delimiter','', 'newline','pc');
%input : 输入数据(复数)
%row :输入数据长度
%N :实部虚部的位宽
%file_path :输出数据的保存路径
for i=1:row
a(i) = real(input(i));
b(i) = imag(input(i));
if a(i) <0
a(i) = a(i) + 2^N ; %65536;
end
if b(i) <0
b(i) = b(i) + 2^N ; %65536;
end
end
aa=dec2hex(a);
bb=dec2hex(b);
m=[aa bb];
%dlmwrite(file_path, m,'delimiter','', 'newline','pc','-append');
dlmwrite(file_path, m,'delimiter','', 'newline','pc');