|
12 | 12 | % jdatadecode - newdata=jdatadecode(data,opt,...) |
13 | 13 | % jdataencode - jdata=jdataencode(data) |
14 | 14 | % jsave - jsave(fname,'param1',value1,'param2',value2,...) |
15 | | -% jload - jload(fname,'param1',value1,'param2',value2,...) |
| 15 | +% jload - vars=jload(fname,'param1',value1,'param2',value2,...) |
16 | 16 | % jsonopt - val=jsonopt(key,default,optstruct) |
17 | 17 | % loadbj - data=loadbj(fname,opt) |
18 | 18 | % loadjson - data=loadjson(fname,opt) |
|
726 | 726 | % to a field in opt. opt can have the following |
727 | 727 | % fields (first in [.|.] is the default) |
728 | 728 | % |
729 | | -% ws ['base'|'wsname']: the name of the workspace in which the |
| 729 | +% ws ['caller'|'base']: the name of the workspace in which the |
730 | 730 | % variables are to be saved |
731 | 731 | % vars [{'var1','var2',...}]: cell array of variable names to be saved |
732 | 732 | % matlab [0|1] if set to 1, use matlab's built-in jsonencode to |
733 | 733 | % store encoded data to a json file; output file |
734 | 734 | % must have a suffix of .jdt |
735 | 735 | % |
736 | | -% all options for saveubjson/savejson (depends on file suffix) |
| 736 | +% all options for savebj/savejson (depends on file suffix) |
737 | 737 | % can be used to adjust the output unless "'matlab',1" is used |
738 | 738 | % |
739 | 739 | % output: |
740 | 740 | % varlist: a list of variables loaded |
741 | 741 | % |
742 | 742 | % examples: |
743 | | -% jsave % save all variables in the 'base' workspace to jamdata.jamm |
| 743 | +% jsave % save all variables in the 'caller' workspace to jamdata.jamm |
744 | 744 | % jsave('mydat.jamm','vars', {'v1','v2',...}) % save selected variables |
745 | 745 | % jsave('mydat.jamm','compression','lzma') |
746 | 746 | % |
|
753 | 753 | % jload |
754 | 754 | % or |
755 | 755 | % jload(fname) |
| 756 | +% varlist=jload(fname) |
| 757 | +% [varlist, header]=jload(fname) |
756 | 758 | % varlist=jload(fname,'param1',value1,'param2',value2,...) |
757 | 759 | % |
758 | 760 | % Load variables from a JSON or binary JSON file to a workspace |
|
769 | 771 | % to a field in opt. opt can have the following |
770 | 772 | % fields (first in [.|.] is the default) |
771 | 773 | % |
772 | | -% ws ['base'|'wsname']: the name of the workspace in which the |
| 774 | +% ws ['caller'|'base']: the name of the workspace in which the |
773 | 775 | % variables are to be saved |
774 | 776 | % vars [{'var1','var2',...}]: list of variables to be saved |
775 | 777 | % header [0|1]: if set to 1, return the metadata of the variables |
|
782 | 784 | % can be used to adjust the parsing options |
783 | 785 | % |
784 | 786 | % output: |
785 | | -% varlist: a list of variables loaded |
| 787 | +% varlist: a struct with each subfield a variable stored in the file, |
| 788 | +% if output is ignored, the variables will be loaded to the |
| 789 | +% workspace specified by the 'ws' option, which by default |
| 790 | +% load the variables to the current workspace ('caller') |
786 | 791 | % |
787 | 792 | % examples: |
788 | | -% jload % load all variables in jamdata.jamm to the 'base' workspace |
| 793 | +% jload % load all variables in jamdata.jamm to the 'caller' workspace |
789 | 794 | % jload mydat.jamm |
790 | 795 | % jload('mydat.jamm','vars', {'v1','v2',...}) % load selected variables |
791 | | -% jload('mydat.jamm','simplifycell',1) |
| 796 | +% varlist=jload('mydat.jamm','simplifycell',1) |
792 | 797 | % |
793 | 798 | % license: |
794 | 799 | % BSD or GPL version 3, see LICENSE_{BSD,GPLv3}.txt files for details |
|
1425 | 1430 | % license: |
1426 | 1431 | % BSD or GPL version 3, see LICENSE_{BSD,GPLv3}.txt files for details |
1427 | 1432 | % |
1428 | | - |
1429 | | - |
|
0 commit comments