Load data.mat with changing file name
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Characters and Strings en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!