I am making a program in Matlab to analyze the data of some biomedical data that I have collected. The calculations are very simple but repeatable, so I am interested in writing a small program. I have one matrix (200 x 99) per patient, which is stored in a variable with the name of the patient. I created a function that results in an output variable (finalresult) containing everything I need from this patiรซnts matrix.
I would really like this output variable to bear the name of my input variable. Thus, I can simply call the function for each patient separately, and then collect a list of variables in the workspace instead of manually changing the name of the output variable after each function call.
I hope you understand what I would like to achieve. This is a simplified example of my code:
function [ finalresult] = total_analysis( patientname) first = patientname(:,1)*2; second = first; finalresult = vertcat(first,second); end
=> output variable name is always finalresult
BUT I would like it to be a unique other "output variablename , preferably finalresult_patientname or patient name
source share