i have data in database in this format 1,2,3,4,5. and when it fetch it through query it returns [1x9 char]

1 次查看(过去 30 天)
how can i convert it into original data.
  2 个评论
the cyclist
the cyclist 2013-7-31
It is very difficult to help you with more details. Remember, the only things we know about your problem are what you tell us.
Here are some of the things that would help to know:
  • What type of database is it?
  • What is the variable type in the database?
  • Is that data all from one column, or from 5 columns?
  • What is the query you used?
Ali Asad
Ali Asad 2013-7-31
the data is in one column. and i used the following query query = 'select XTermination from Image'; % XTermination is column name curs = exec(con, query); curs=fetch(curs); curs.Data %to display data

请先登录,再进行评论。

采纳的回答

the cyclist
the cyclist 2013-7-31
It seems that in the database, is the variable XTermination of type "character".
If so, then MATLAB is simply reading that character string in, and that is the original data.
For this simple case, you might be able to convert it as follows:
numberList = str2num(curs.Data)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Database Toolbox 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by