Can I import dynamic data from a private server into Matlab?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello,
I am currently writing some code in Matlab to process data from a private server (with private I mean that every time I login, it asks me for the password). To do so, I have been downloading the data everyday into .csv files.
The data on the server is updated every minute.
Is there a way to connect Matlab to the private server, give Matlab the power to remember the password (or override it) and, when the code runs, to collect all updated data?
Thank you very much.
Sidenote: I am at a pretty basic level of Matlab.
4 comentarios
Turlough Hughes
el 9 de Mzo. de 2020
Try what Guillaume suggested. Let us know if you have any errors coming back.
Respuestas (2)
Guillaume
el 9 de Mzo. de 2020
How easy this is to do is going to depend on the server (how it is implemented). You would use one of webread, webwrite or websave.
Assuming your server is fully REST compatible, and it uses basic or digest authentication, accessing your data may be as easy as:
url = 'https://yourprivateserver/somelocation/somefile.csv';
username = 'yourusername';
password = 'secret'; %note that if write it in an m file, anybody who has access to the m file can read your password
data = webread(url, weboptions('Username', username, 'Password', password));
0 comentarios
Enric Astals
el 10 de Mzo. de 2020
3 comentarios
Guillaume
el 11 de Mzo. de 2020
Can you give us the full text of the error message so we can understand if it comes from matlab or your server?
Matlab does no check at all on the content of the password, it just passes it to the server. However, it sounds like you have a syntax error.
Ver también
Categorías
Más información sobre Startup and Shutdown en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!