How to call the function BlandAltman as an array

The following function helps to run the Bland Altman Correlation plots:
function [array] = BACorrelation(RR_loc_ref, RR_ref, RR_loc, RR)
...
BlandAltman(RR_ref,RR_matched)
end
Now, how can I store the function into an array, so that I can overlap many different correlation plots in a single figure?.
function [array] = BACorrelation(RR_ref, RR_matched)
array = [];
array = BlandAltman(RR_ref,RR_matched);
end
that one can therefore call from the main function:
function main
[array] = BlandAltman(RR_ref,RR_matched);
figure
hold on;
for i=1:length(array)
figure
plot(array{i})
end
hold off;
end
}
Greetings,
Dav

1 Kommentar

Jan
Jan am 2 Jul. 2022
As far as I can see, BlandAltman is not a function of Matlab's toolboxes. We cannot guess, which function you use, so please mention this explicitly.
You can neither "call a function as array" or "store a function in an array", but if the function can handle arrays as inputs, it might reply an array as output. Does the help section of this function explain its inputs and outputs?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Rik
Rik am 2 Jul. 2022
Bearbeitet: Rik am 2 Jul. 2022
You can use my BlandAltmanPlot function and use the GroupIndex paramater to plot several point on a single graph.
var1=[494,395,516,434,476,557,413,442,650,433,417,656,267,478,178,423,427];
var2=[512,430,520,428,500,600,364,380,658,445,432,626,260,477,259,350,451];
grouping=[ones(1,8) 2*ones(1,9)];
h=BlandAltmanPlot(var1,var2,'GroupIndex',grouping);
% Change the appearance of all markers:
set(h.plot.data,'Marker','*')
% Change the appearance of the markers for a subgroup:
set(h.plot.data(1),'Color','r','Marker','o')
% Change a property of the axes:
ax=get(h.plot.data(1),'Parent');
set(ax,'YTick',-100:50:100)

Kategorien

Mehr zu Language Fundamentals finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2020b

Gefragt:

am 2 Jul. 2022

Bearbeitet:

Rik
am 2 Jul. 2022

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by