필터 지우기
필터 지우기

Database toolbox downloading individual data as cell arrays

조회 수: 1 (최근 30일)
Azura Hashim
Azura Hashim 2016년 7월 20일
답변: Azura Hashim 2016년 7월 22일
Hi, I am using database toolbox to fetch data using MySql. However the fetched data matrix consists of individual values as cell arrays. How can I download the data as a matrix consisting as simple values? I simply want to download the entire table as a simple matrix. Thanks.

답변 (2개)

Guillaume
Guillaume 2016년 7월 20일
I don't have the database toolbox but I assume it returns the contents of a table as a cell array because there is no guarantee that the columns are numeric and never empty.
If you are sure that the columns are always numeric and never empty, then:
dataasmatrix = cell2mat(yourfetcheddata)

Azura Hashim
Azura Hashim 2016년 7월 22일
Excellent, this works. Thanks for your help.

카테고리

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