Subplots and thier Position (Expert needed)
1 次查看(过去 30 天)
显示 更早的评论
somebody before me has writen this code and now I need to optimize it.But I dont get it. This Code creats Ncam(most times 9) plots in a figure......I already lost my mind.
e.g. isn't 2+1 = 3 ?
If u are reading this: pls tell my ur Thoughts on this code. Thanks
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
for i = 1:Ncam
rows = 2;
cols = round(Ncam)/2+1;
bound = 0.045;
width = (1/rows)-(bound*1.4);
height = (1/cols)-(bound*1.5);
subplot('position',[(bound+(mod(i-1,2)/rows)) (bound+((floor(((Ncam-i+1)+1)/2)-1)/cols)) width height])
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
0 个评论
采纳的回答
Mischa Kim
2014-7-10
Max, are you referring to
cols = round(Ncam)/2+1;
(I believe not)? If so, the code first divides by 2 and then adds 1 to the result. As opposed to
cols = round(Ncam)/(2+1); % note the brackets
In other words, what and where exactly is the problem? What do you want the code to do?
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subplots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!