画像の描き方
8 ビュー (過去 30 日間)
古いコメントを表示
I(x,y)=cos^2((x^2+y^2)/45^2)
512×512サイズ
上記画像を描くプログラムの作り方を教えてください。
採用された回答
Hiroki Okawa
2019 年 11 月 1 日
編集済み: Hiroki Okawa
2019 年 11 月 1 日
[X, Y] = meshgrid(-255:256, -255:256);
I = cos((X.^2 +Y.^2)/45^2).^2;
figure;
imshow(I)
でいかがでしょうか。 グレースケールであれば私はimshow関数をよく使っています。
その他の回答 (2 件)
Kazuya
2019 年 11 月 1 日
編集済み: Kazuya
2019 年 11 月 1 日
どんな絵でしょうか。。 プロットするなら fsurf 関数も便利。 https://jp.mathworks.com/help/matlab/ref/fsurf.html
fsurf(@(x,y) cos((x.^2+y.^2)/45.^2).^2)
2次元なら fcontour 関数かな。
fcontour(@(x,y) cos((x.^2+y.^2)/45.^2).^2,'Fill','on')
512×512サイズに出力する話は、どんな絵をイメージされているかをうかがってからに。。
2 件のコメント
参考
カテゴリ
Help Center および File Exchange で イメージ算術 についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!