필터 지우기
필터 지우기

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 CenterFile Exchange에서 HDF5에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by