How to call the function BlandAltman as an array

2 次查看(过去 30 天)
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 个评论
Jan
Jan 2022-7-2
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?

请先登录,再进行评论。

回答(1 个)

Rik
Rik 2022-7-2
编辑:Rik 2022-7-2
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)

类别

Help CenterFile Exchange 中查找有关 Specifying Target for Graphics Output 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by