how to create a mat file of a given image with the same file name?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
t=imread('a.jpg') is the code. my output mat file should be a.mat what is the code.
0 Kommentare
Antworten (2)
Lisa Wu
am 10 Mai 2013
Bearbeitet: Walter Roberson
am 23 Jul. 2023
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
2 Kommentare
Yao Li
am 10 Mai 2013
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 Kommentare
Stephen23
am 23 Jul. 2023
"is it mandatory to remove the jpg extension?"
No.
"If yes... then how to remove it?"
Siehe auch
Kategorien
Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!