|
| 1 | + |
| 2 | + |
| 3 | +# h5save |
| 4 | + |
| 5 | +# save |
| 6 | + |
| 7 | +save workspace variables to .nh5 file |
| 8 | + |
| 9 | +## Syntax |
| 10 | + |
| 11 | +- h5save(filename) |
| 12 | +- h5save(filename, var1, ..., varN) |
| 13 | +- h5save(filename, '-append', ...) |
| 14 | +- h5save(filename, '-nocompression', ...) |
| 15 | + |
| 16 | +## Input argument |
| 17 | + |
| 18 | + - filename - a string: .nh5 filename. |
| 19 | + - var1, ..., varN - string: Names of variables to save from Nelson's workspace. |
| 20 | + - '-append' - append variables to an existing .nh5 file. |
| 21 | + - '-nocompression' - disable .nh5 file compression. |
| 22 | + |
| 23 | +## Description |
| 24 | + |
| 25 | + |
| 26 | + <p><b>h5save</b> save workspace variables to .nh5 file.</p> |
| 27 | + <p>.nh5 file uses hdf5 file as container.</p> |
| 28 | + |
| 29 | + |
| 30 | +## Examples |
| 31 | + |
| 32 | +```matlab |
| 33 | +A = ones(3, 4); |
| 34 | +B = 'hello for open mat users'; |
| 35 | +h5save([tempdir(), '/example_h5load.nh5'], 'A', 'B') |
| 36 | +clear; |
| 37 | +st = h5load([tempdir(), '/example_h5load.nh5']); |
| 38 | +who |
| 39 | +st.A |
| 40 | +st.B |
| 41 | +clear |
| 42 | +who |
| 43 | +h5load([tempdir(), '/example_h5load.nh5']); |
| 44 | +who |
| 45 | +A |
| 46 | +B |
| 47 | +``` |
| 48 | +append variables |
| 49 | +```matlab |
| 50 | +C = eye(3, 4); |
| 51 | +h5save([tempdir(), '/example_h5load.nh5'], 'C', '-append') |
| 52 | +clear; |
| 53 | +st = h5load([tempdir(), '/example_h5load.nh5']); |
| 54 | +who |
| 55 | +st.A |
| 56 | +st.B |
| 57 | +st.C |
| 58 | +clear |
| 59 | +who |
| 60 | +h5load([tempdir(), '/example_h5load.nh5']); |
| 61 | +who |
| 62 | +A |
| 63 | +B |
| 64 | +C |
| 65 | +``` |
| 66 | +compression |
| 67 | +```matlab |
| 68 | +C = eye(1000, 1000); |
| 69 | +h5save([tempdir(), '/example_h5save_with_compression.nh5'], 'C') |
| 70 | +h5save([tempdir(), '/example_h5save_no_compression.nh5'], 'C', '-nocompression') |
| 71 | +with_compression = dir([tempdir(), '/example_h5save_with_compression.nh5']) |
| 72 | +no_compression = dir([tempdir(), '/example_h5save_no_compression.nh5']) |
| 73 | +``` |
| 74 | + |
| 75 | +## See also |
| 76 | + |
| 77 | +[h5load](h5load.md), [h5write](h5write.md). |
| 78 | +## History |
| 79 | + |
| 80 | +|Version|Description| |
| 81 | +|------|------| |
| 82 | +|1.0.0|initial version| |
| 83 | + |
| 84 | + |
| 85 | +## Author |
| 86 | + |
| 87 | +Allan CORNET |
| 88 | + |
| 89 | + |
| 90 | + |
0 commit comments