Load data.mat with changing file name
Afficher commentaires plus anciens
Hello, I have multiple database stored in a file as : DB201706.mat DB201707.mat DB201708.mat
I want to creat a function that allows me to call the database that i want and use it in my calculation :
function [Output] = testbd()
load 'C:\MYFILE\test\DB20170730.mat'
gama = A(1);
Output = gama;
end
Is there a way to set the name of the database as an Input to the function in order to avoid entering the name manually.
function [Output] = testbd( Name)
load 'C:\MYFILE\test\ Name.mat'
gama = A(1);
Output = gama;
end
Thank you for your help
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Characters and Strings dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!