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!