I am making a program in matlab for data analysis of some biomedic data I collected. The calculations are really easy yet repetitive, hence my interest in writing a small program. I have one matric (200 x 99) per patient, 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 carry the name of my input variable. That way I can simply call the function for each patient separately and afterwards harvest a list of variables in the workspace instead of having to manually change the name of the output variable after each function call.
I hope you understand what I would like to achieve. This is the simplified example of my code:
function [ finalresult] = total_analysis( patientname)
first = patientname(:,1)*2;
second = first;
finalresult = vertcat(first,second);
end
=> the output variable name is always finalresult
BUT I would like it to be a "unique other" output variablename, preferably finalresult_patientname or patientname