LoginSignup
1
2

More than 5 years have passed since last update.

viewpointを変えながら連番で画像を保存

Last updated at Posted at 2012-12-26

色々な結果を一枚のキャンバスにplotした画像を、毎回viewpointを変えながら保存したい場合。
注意したいのはfor文の中にclearを使う処理を入れていると、後のiなどの値に影響が出る。そういう場合はclearvarsなどで対応。

az = 0;
el = 0;

f = figure; %ここでfigureのハンドルを取得。
grid;       %gridが欲しければ。

for i = 1:10

view(az,el); %viewpointを指定。
plot(); %plotする。

filename = sprintf('file/path.jpg', i);
saveas (f,filename, 'jpg');

el = el + 5; %5°ずつ変化させる。
end

1
2
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2