- Connect to the MySQL database - https://www.mathworks.com/help/database/ug/database.mysql.connection.html.
- Extract data from the database - Use the "sqlread" function to read data from a specific table. https://www.mathworks.com/help/database/ug/database.odbc.connection.sqlread.html.
- Create a 3D matrix - Assuming the output of "sqlread" is in a table format, use the "table2array" and "reshape" functions to convert the table to an array and reshape the array into a 3D matrix. https://www.mathworks.com/help/matlab/ref/table2array.html, https://www.mathworks.com/help/matlab/ref/double.reshape.html.
- Close the connection
How can I communicate with Mysql database with Matlab, extract the data and create a three dimensional matrix with Matlab?
1 回表示 (過去 30 日間)
古いコメントを表示
Hi !
How can I communicate with Mysql database with Matlab, extract the data and create a three dimensional matrix with Matlab?
0 件のコメント
回答 (1 件)
Piyush Kumar
2024 年 9 月 27 日
@gd,
To communicate with the Mysql database with Matlab, extract the data, and create a three-dimensional matrix, try these steps -
Please check the links that I have shared after each step. They have explained how to perform the steps with explanation.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Database Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!