Subplots and thier Position (Expert needed)

1 回表示 (過去 30 日間)
Max Müller
Max Müller 2014 年 7 月 10 日
コメント済み: Max Müller 2014 年 7 月 11 日
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])
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

採用された回答

Mischa Kim
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?
  1 件のコメント
Max Müller
Max Müller 2014 年 7 月 11 日
that was very stupid. Of curse its not 3...... yesterday was not my day. Thanks a lot. I got the solution now.....
have a nice day.
PS: Send me an OK, so i can remove the question.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSubplots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by