From 8fffad1b552e16cd46a4de7071cc70fbf72334af Mon Sep 17 00:00:00 2001
From: ZaellixA <axilleaz@protonmail.com>
Date: Sun, 15 Sep 2024 17:14:10 +0100
Subject: [PATCH] Fix bug in ptSrcFieldTD.m to allow providing single source
 signal

---
 Sound Fields/MATLAB/Functions/ptSrcFieldTD.m | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Sound Fields/MATLAB/Functions/ptSrcFieldTD.m b/Sound Fields/MATLAB/Functions/ptSrcFieldTD.m
index 01fa2c6..422cb6e 100644
--- a/Sound Fields/MATLAB/Functions/ptSrcFieldTD.m	
+++ b/Sound Fields/MATLAB/Functions/ptSrcFieldTD.m	
@@ -3,7 +3,7 @@
 % Author: Achilles Kappis
 % e-mail: axilleaz@protonmail.com
 %
-% Date: 14/09/2024 (DD/MM/YYYY)
+% Date: 15/09/2024 (DD/MM/YYYY)
 %
 % Copyright: MIT
 % --------------------------------------------------
@@ -102,8 +102,8 @@ function [rSig, rSigMean, rSigMtx, rSigMtxMean, Q] = ptSrcFieldTD(sPos, rPos, fs
     if nargin > 3 && ~isempty(Q)
         if isscalar(Q)
             validateattributes(Q, "numeric", {'scalar', 'real', 'nonnan', 'nonempty', 'finite', 'positive', 'integer'}, mfilename, "Length of source signals in samples", 4);
-        elseif isvector(Q)
-            validateattributes(Q, "numeric", {'vector', 'real', 'nonnan', 'nonempty', 'finite', 'numel', size(sPos, 1)}, mfilename, "Source signals", 4);
+        elseif isvector(Q) && size(Q, 2) == size(sPos, 1)
+            validateattributes(Q, "numeric", {'vector', 'real', 'nonnan', 'nonempty', 'finite', 'ncols', size(sPos, 1)}, mfilename, "Source signals", 4);
         else
             validateattributes(Q, "numeric", {'3d', 'real', 'nonnan', 'nonempty', 'finite', 'ncols', size(sPos, 1)}, mfilename, "Source signals", 4);
         end
-- 
GitLab