フィルターのクリア

How to put a String in a dataset attribute

4 ビュー (過去 30 日間)
Thomas
Thomas 2013 年 3 月 12 日
編集済み: per isakson 2014 年 10 月 29 日
I am currently using this code
dset = single(1);
dset_details.Location = '/metaData';
dset_details.Name = 'stringTest';
attr = 'char';
attr_details.Name = 'Pathtest';
attr_details.AttachedTo = '/metaData/stringTest';
attr_details.AttachType = 'dataset';
hdf5write('C:\withstrings.h5', dset_details, dset ...
, attr_details, attr, 'WriteMode', 'append' );
_____________________________________________________________________
But the problem is that I dont want numeric data but i want to as an example: 'C:\path' into the value.
What kind of datatype do i have to use? Because i have a program that automaticaly gives in the pathname. But when it saves into the h5 file it automatically gives the ASCII code from the path into the data but I don't want it to be ASCII Code i just want the full pathname to be in it as a string value.
No matter what type i use, a single, a double, it always converts into ASCII code, how can i save it to be just a string, just the pathname like: 'c:\path'
Can anyone help me with this?
Thanks.

回答 (1 件)

Ashish Uthama
Ashish Uthama 2013 年 3 月 12 日
Second example h5d.write doc page shows how to write strings. (using cell arrays)

カテゴリ

Help Center および File ExchangeHDF5 についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by