Does MATLAB have a function to write data / text to a specific field on a website
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I want to write data to a website (https://rnacomposer.cs.put.poznan.pl/) that requires seperate lines of text. I want to test it out first doing one at a time and then switch to the batch file method. Does MATLAB have functions already developed to write to a website in this manner?
0 comentarios
Respuestas (1)
Tanmay Das
el 28 de Dic. de 2021
Hi,
You may use the "webwrite" function to write data to a website. You may specify field name and corresponding field value to fill the data in that particular field. Here is an example for your reference:
thingSpeakURL = 'http://api.thingspeak.com/';
thingSpeakWriteURL = [thingSpeakURL 'update'];
writeApiKey = 'Your Write API Key';
fieldName = 'field1';
fieldValue = 42;
response = webwrite(thingSpeakWriteURL,'api_key',writeApiKey,fieldName,fieldValue)
2 comentarios
Sivani Pentapati
el 22 de Feb. de 2022
Hi Stephen,
The Media Type for a structure has to be set to 'json' in the weboptions as you are passing a structure in webwrite function. Please find the below code to write the TestSequence structure as JSON object.
url = 'https://rnacomposer.cs.put.poznan.pl/';
TestSequenc.Name = 'TestSequence';
TestSequence.Sequence = 'GCUCCUAGAAAGGCGCGGGCCGAGGUACCAAGGCAGCGUGUGGAGC';
TestSequenceStructure: '(((((.......((((..(((..........))).))))..)))))';
options = weboptions('MediaType', 'application/json');
response = webwrite(httpsUrl, employee, options)
Ver también
Categorías
Más información sobre JSON Format 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!