设图像矩阵为A。。
1、读取图像
2、显示图像
imshow(A,[])
3、保存图像
imwrite
○ 作用:imwrite Write image to graphics file.
○ 用法:imwrite(A,FILENAME,FMT) writes the image A to the file specified by FILENAME in the format specified by FMT.
○ 说明:FILENAME is a string that specifies the name of the file.最好是绝对路径文件名,这样就可以保存到自己想要的路径中。
构造绝对路径,将两个字符串连载一起的方法:
str1=’Iloveyou’; str2=’123’;
1、方法一:
用中括号将str1和str2像矩阵元素一样包含起来:
SC=[str1,str2]
输出:SC = Iloveyou123