From d388463e5f9905fc549f2597297df76009065f1d Mon Sep 17 00:00:00 2001 From: kar <kas2020@protonmail.com> Date: Fri, 25 Feb 2022 15:39:29 -0500 Subject: [PATCH] fixed small bug in matlab script for QSP --- matlab/spins_QSP_csv.m | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/matlab/spins_QSP_csv.m b/matlab/spins_QSP_csv.m index 63f60d0..d544e59 100644 --- a/matlab/spins_QSP_csv.m +++ b/matlab/spins_QSP_csv.m @@ -1,15 +1,19 @@ -function [T1_max, T1_min, S1_max, S1_min, pdfCount] = spins_QSP_reader(filename) - % Reads in the csv file and interprets it in the correct way for the user. - % - % Input: Filename (string) name of csv file. - % - % Output: Returns the max/min values for T1 and S1 (as specified in - % spins.conf) and the (normalized) pdfCount histogram. +function [T1_max, T1_min, S1_max, S1_min, pdfCount] = spins_QSP_csv(filename) + %% Reads in the csv file and interprets it in the correct way for the user. + %% + %% Input: + %% Filename (string): name of csv file. + %% + %% Output: + %% T1_max (float): upper limit of the maximum-valued bin of T1 tracer + %% T1_min (float): lower limit of the minimum-valued bin of T1 tracer + %% S1_max (float): upper limit of the maximum-valued bin of S1 tracer + %% S1_min (float): lower limit of the minimum-valued bin of S1 tracer A = importdata(filename); T1_max = A(1, 1); T1_min = A(1, 2); S1_max = A(1, 3); S1_min = A(1, 4); pdfCount = A(2:end, :); - pdfCount /= sum(sum(pdfCount)); + pdfCount = pdfCount / sum(sum(pdfCount)); end -- GitLab