我正在运行
>> webread(url)
Error using webread (line 116)
Too many input arguments.
url
只是返回JSON的网址。
更新
>> webread('https://jsonplaceholder.typicode.com/users');
116 [url, postData, options] = encodeInputs(url, queryParams, options);
Error using webread (line 116)
Too many input arguments.
>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.1.0.441655 (R2016b)
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 16299)
Java Version: Java 1.8.0_111-b14 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
-----------------------------------------------------------------------------------------------------
MATLAB Version 9.1 (R2016b)
....
更新2
功能内容:
function varargout = webread(url, varargin)
...
% Parse the inputs.
[queryParams, options] = parseInputs(mfilename, varargin);
% Encode inputs.
[url, postData, options] = encodeInputs(url, queryParams, options);
116行是最后一行。
路径为C:\Program Files\MATLAB\R2016b\toolbox\matlab\external\interfaces\webservices\restful\webread.m
更新3
跟踪显示根本原因在C:\Program Files\MATLAB\R2016b\toolbox\matlab\external\interfaces\webservices\http\+matlab\+net\URI.m
的#427行中,其中包含:
obj.Path = strsplit(string(value), '/', 'CollapseDelimiters', false);
和
K>> strsplit(string(value), '/', 'CollapseDelimiters', false)
Error using strsplit
Too many input arguments.
K>> value
value =
string
"/users"
和strsplit
是我的功能,它会覆盖内置的一个!