Error using strjoin when sending request URI

I've tried reproducing this example: https://fr.mathworks.com/help/matlab/ref/matlab.net.http.requestmessage.send.html but get an 'Error using strjoin' message. Any help in tracking down what I'm doing wrong is much appreciated.
>> request = matlab.net.http.RequestMessage;
>> uri = matlab.net.URI('https://www.mathworks.com/support/contact_us');
>> resp = send(request, uri)
Error using strjoin
Unsupported input: string
Error in matlab.net.URI/get.EncodedPath (line 514)
str = strjoin(path, '/');
Error in matlab.net.URI/string (line 680)
path = obj.EncodedPath;
Error in matlab.net.URI/char (line 696)
str = string(obj);
Error in matlab.net.http.RequestMessage>getProxySettings (line 2133)
proxyInfo = matlab.internal.webservices.getProxyInfo(char(uri));
Error in matlab.net.http.RequestMessage/send (line 405)
[proxyURI, username, password] = getProxySettings(createURIFromInput(uri));
>>

 採用された回答

埃博拉酱
埃博拉酱 2024 年 10 月 28 日

0 投票

It looks like your version of MATLAB is too old and doesn't support string types yet. It is recommended to update to the latest version.

3 件のコメント

Edward
Edward 2024 年 10 月 28 日
I'm not quite sure what you mean. I am using R2022a, which clearly supports string types. Besides, my colleagues also use R2022a and don't have this error, which is why we are at a loss to explain why it fails for me.
>> test = "someString";
>> class(test)
ans =
'string'
埃博拉酱
埃博拉酱 2024 年 10 月 28 日
編集済み: 埃博拉酱 2024 年 10 月 28 日
Then please check to see if there is an Update that can be installed. Even the same version of MATLAB may have bug fixes in some Updates. At the same time, you can also check whether your strjoin supports string input.
Edward
Edward 2024 年 10 月 28 日
I see thanks, you are right my strjoin does not support string inputs, and got the same error (unsupported input: string) when I tried checking for updates. I will try with a clean re-installation of the latest version. Thanks for your help.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCharacters and Strings についてさらに検索

製品

リリース

R2022a

タグ

質問済み:

2024 年 10 月 28 日

コメント済み:

2024 年 10 月 28 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by