matlab using proper way translation API (recommended!)

Copyright: Reprinted indicate the source https://blog.csdn.net/qq_43157190/article/details/89400624

matlab inside urlread () and webread () function reads two built-in Web content, the proper way so that they can use the API provided by the translation in the translation of internal procedures.

Here is the official instructions proper way translation API:
Here Insert Picture Description
For example, we need to translate i love matlab these words, written in the manner given URL, reads obtained by the urlread function:
Here Insert Picture Description
Here Insert Picture Description
If you need to translate Chinese into English, you must first Chinese utf-8 encoding, use the function urlencode (), or an error occurs. Finally, regular expression string extraction required, you can also use the function to pick strfind.

For example, now I have to translate Chinese word
is returned, there is a long list of strings, we need to part:Here Insert Picture Description
find strfind both ends by two functions:
Here Insert Picture Description
Here Insert Picture Description
through the strrep () function inside too much space and do not need to replace the code with strtrim () function can be removed and trailing spaces:
Here Insert Picture Description

Here Insert Picture Description
mission completed!

Guess you like

Origin blog.csdn.net/qq_43157190/article/details/89400624