-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
savejson & Matlab 2017a: Undefined function or variable 'st'. #34
Comments
@energynumbers, please check out my latest commit and let me know if that fixes the issue in the latest matlab. |
Thanks, it now runs without error. However, it produces JSON which is inconsistent with what I had before - it's losing some data. I'll try to create a small example that reproduces the problem. More news shortly. |
Looks to be some sort of confusion between a char array and a string array. |
OK, the difference in behaviour between 2016b and 2017a is happening in Take this json file:
In 2016b, the resulting variable, after |
Hmmm, maybe |
Ah, confirmed -
|
Going through |
I am having the same problems. function txt=obj2json(name,item,level,varargin)
if(iscell(item))
txt=cell2json(name,item,level,varargin{:});
elseif(isstruct(item))
txt=struct2json(name,item,level,varargin{:});
elseif(ischar(item))
txt=str2json(name,item,level,varargin{:});
elseif ~verLessThan('matlab','9.1') && isstring(item)
% versions 2016a and lower AND item is a string object
% (new string class since 2016b (9.1): isobject("String") returns true)
% Don't know if this is correct in every case:
% convert string to char by: item{:}
txt=str2json(name,item{:},level,varargin{:});
elseif(isobject(item))
txt=matlabobject2json(name,item,level,varargin{:});
else
txt=mat2json(name,item,level,varargin{:});
end |
Calls that formerly worked in Matlab 2016b and earlier, don't work in Matlab 2017a. From savejson I now get:
The text was updated successfully, but these errors were encountered: