Is there a matlab network package called matlab.net​.http.fiel​d.SessionS​tate?

3 ビュー (過去 30 日間)
jun
jun 2025 年 6 月 17 日
回答済み: Abhipsa 2025 年 6 月 19 日
Hi, I am using https://github.com/jebej/MatlabWebSocket to connect a sensor server ,
AI google studio give me some codes, one is :
import matlab.net.http.field.SessionState;
which is a core netwrok service, it told me. but the matlab can not find it,
so the AI let me run:
exist(fullfile(matlabroot, 'toolbox', 'matlab', 'network', '+matlab', '+net', '+http'), 'dir')
and the answer is 0, so the AI told me that some core package related network is missing.
But I reinstalled the matlab, still can not find the package.
Is AI correct or AI hallucinations?

回答 (1 件)

Abhipsa
Abhipsa 2025 年 6 月 19 日
Hello @jun,
It seems like the AI agent has provided some inaccurate information regarding the existence of "matlab.net.http.field.SessionState" class.
The command you used needs some modifications as shown below, as "matlab.net.http.field" package is a part of the MATLAB's Web Services interface :
>> exist(fullfile(matlabroot, 'toolbox', 'matlab', 'external', 'interfaces', 'webservices', 'http', '+matlab', '+net', '+http', '+field'), 'dir')
To verify the list of officially supported HTTP header field classes, you can refer to the MATLAB documentation here:
This page lists all available classes in the "matlab.net.http.field" package. As you’ll see, there is no "SessionState" field included.
I hope this resolves your query.

カテゴリ

Help Center および File ExchangeCall Web Services from MATLAB Using HTTP についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by