how to get the matfile with a particular name
1 次查看(过去 30 天)
显示 更早的评论
i have 10 matfiles named 1.mat, 2.mat to 10.mat.... In these 10 matfiles i have saved a variable varValue...... Based on a calculation i get a value between 1 and 10..... If i get 3..... i need to load 3.mat..... but i dont know how to load it to get the varValue in 3.mat.....
i as below...
outputValue = '3';
pathName = 'DB_Matfiles/';
dataFilename = [pathName imageName '.mat']
vars = {'varValue'};
BW = load(dataFilename, vars{:});
sir this varValue actually contains an binary image.... but when i use imshow(BW),
i cant view it...
but if i do
load 1.mat
imshow(varValue);
it works..... sir how get the matfile saved in folder 'DB_Matfiles' and named as 1.mat to 10.mat...
if i get 3....
it should load 3.mat from 'DB_Matfiles' folder...
please do reply sir.....
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Workspace Variables and MAT-Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!