MATLAB urlread cannot determine file status if they exist
Mostrar comentarios más antiguos
Hello:
I am using urlread function to check if particular file exists in a web-page. I have used the following command:
[~, Status] = urlread('https://www.ncei.noaa.gov/data/global-summary-of-the-day/access/1981/01001099999.csv')
Even if the file exists in the webpage, 'https://www.ncei.noaa.gov/data/global-summary-of-the-day/access/1981/', the Status shows 0. Webread cant give the file status. Kindly help!
4 comentarios
Philipp Prestel
el 24 de Jun. de 2023
Editada: Philipp Prestel
el 24 de Jun. de 2023
Just a comment since i sadly don't have your answer but I might know where your problem is;
Looking at the documentation, urlread isn't recommended for https protocols, it recommends to use webread instead.
So i'd try using that and maybe check "Use HTTP with MATLAB" for more information on using http with mathlab
Edit: Don't know whrether the http functions also work with https, sorry.
Parag Jhunjhunwala
el 25 de Jun. de 2023
Which MATLAB release are you using for running the command? I tried running it in the latest release(R2023a) and the Status shows 1.
Poulomi Ganguli
el 25 de Jun. de 2023
It works for me in R2019b. If you're trying to do certain things in very old versions, you may find that either some certs or java settings are out of date.
The way urlread() is called silenced any error messages, so we're blind as to why it was failing. If it's still necessary to try troubleshooting, it would help to know what version that was and what the suppressed error message is. If you call urlread() fewer than two outputs, it will dump an error message.
Respuestas (0)
Categorías
Más información sobre Web Services 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!