matlab code
1 回表示 (過去 30 日間)
古いコメントを表示
hiii i need a matlab code on how to view a matrix as an image ???? we have a matrix and i need to view it as image
0 件のコメント
採用された回答
Chandra Kurniawan
2012 年 1 月 15 日
Hi,
You can use imagesc command from Matlab
A = [ 0 1 1 1 0;
0 1 1 1 0;
0 0 1 0 0;
0 0 1 0 0;
1 1 1 1 1;
0 0 1 0 0;
0 0 1 0 0;
0 1 1 1 0;
1 0 0 0 1];
imagesc(A); colormap(gray);
axis square;
2 件のコメント
Chandra Kurniawan
2012 年 1 月 15 日
You can use command 'imread' to read image from disk.
Eq :
I = imread('C:\Document\nasa.jpg');
In the Matlab workspace, I will threaten as matrix.
Then If you want to convert it back to image, you can use 'imwrite' command from Matlab
Eq:
I = imread('C:\Document\nasa.jpg');
imwrite(I,'picture001.bmp','bmp');
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!