From 1d5a8634e3a54bbcd2e6ac3074e6c38f085feef0 Mon Sep 17 00:00:00 2001 From: Matthias Kamuf Date: Wed, 4 May 2022 14:56:11 +0200 Subject: Added source files for simple FIR filter --- matlab/comms/save_variable.m | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 matlab/comms/save_variable.m (limited to 'matlab/comms/save_variable.m') diff --git a/matlab/comms/save_variable.m b/matlab/comms/save_variable.m new file mode 100755 index 0000000..6bc45e6 --- /dev/null +++ b/matlab/comms/save_variable.m @@ -0,0 +1,16 @@ +function save_variable (var, format, filename) + +% function save_variable (var, format, filename) +% +% Saves a variable var to filename using format, +% e.g., save_variable (x, '%d', 'input.dat'); + +[fid, message] = fopen(filename, 'w'); +if fid == -1 + disp('File error. Message returned was:') + disp(message) + return +end +fprintf(fid, [format,'\n'], var); +fclose(fid); +return; -- cgit v1.2.3