how to create a mat file of a given image with the same file name?
이전 댓글 표시
t=imread('a.jpg') is the code. my output mat file should be a.mat what is the code.
답변 (2개)
Lisa Wu
2013년 5월 10일
편집: Walter Roberson
2023년 7월 23일
t = imread('a.jpg ');
save('a.mat','t'); % save the varible t to a.mat
Usage of function SAVE is :
save (FILENAME ,VARIABLES)
and both filename and varible should be a string ,
for example ,filename shoule be 'filename.extension ';
Know more about SAVE ,you can type Help save in command window
Yao Li
2013년 5월 10일
0 개 추천
try
strcat()
to define the name of the mat file
For example, filename='a';
matfilename=strcat(filename,'.mat');
save(matfilename,'t');
You may also have to create a function to remove the extension of the figure name (.jpg)
댓글 수: 2
Sivakumaran Chandrasekaran
2013년 5월 10일
Stephen23
2023년 7월 23일
"is it mandatory to remove the jpg extension?"
No.
"If yes... then how to remove it?"
카테고리
도움말 센터 및 File Exchange에서 Image Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!