フィルターのクリア

App Designer charting issue with data not linking

2 ビュー (過去 30 日間)
Nathaniel Johnston
Nathaniel Johnston 2021 年 2 月 13 日
回答済み: Jacob Mathew 2024 年 2 月 28 日
Hi
I am wondering if someone would be able to steer me in the right direction, currently I am trying to build a UI for charting i have created my data base and connected it to matlab from MySQL workbench and it is showing data which is great and when I type it is showing the variable and it is in the workspace too.
My current issue is trying to get the data to plot in a graph in app designer it doesn't seem to be able to reference the data it is saying it can't resolve the issue or dot indexing isn't supported.
I have code in the start up function
This is the code I have in
datasource = 'namedata';
username = 'user';
password = 'pass';
query = ['SELECT * ' ...
'FROM namedata.players'];
data = query;
plot(app.UIAxes,[data.Weight_kg]);
  1 件のコメント
Jacob Mathew
Jacob Mathew 2024 年 2 月 28 日
After reading through your question, there is limited data available to fully grasp your query. Suggest that you share the code, dataset, and the error you are facing at which line of the code to help solve the issue further.

サインインしてコメントする。

回答 (1 件)

Jacob Mathew
Jacob Mathew 2024 年 2 月 28 日
With the limited context provided, a workaround could be to identify what datatype the variables are. Datatypes like array or cell array cannot be accessed using the dot operator and instead requires the use of parenthesis i.e () and curly braces i.e {} respectively. The documentation below showcases some examples of using these:
Further, please ensure that the SQL Query is being executed before being stored in the variable data. Refer to how to use SQL in MATLAB in the below documentation:

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by