Storing data of the whole uitable into a variable

I am a beginner in Matlab and my teacher assigned us a task of creating an app where you can store matrices in different variables and then using those variables to conduct different operations(e.g. addition subtraction, multiplication and division). Currently I have only accomplished on inputing data into the uitable as a matrix via inputdlg and planning on adding a "Store" button to store the data from the uitable into a variable. Is there any way to store data from uitable in to a variable?
Here is my file for reference:

3 comentarios

Rik
Rik el 3 de Nov. de 2023
You mean you want to use that variable outside of you app? That is not needed if you simply want to perform these operations.
It seems a strange way to teach the basics. While a GUI is nothing scary in Matlab, I don't think I would personally have chosen it as a starting point. To learn the Matlab basics you may consider doing the Onramp tutorial (which is provided for free by Mathworks). That should provide some solid ground to continue with your course.
Are you sure you aren't supposed to create your own +-*/ calculator?
Gustav
Gustav el 3 de Nov. de 2023
May I know your suggestion as to what should I do to store the values inside the uitable into a variable?
Yeah its like creating a calculator for matrices.
Rik
Rik el 3 de Nov. de 2023
The contents of a uitable are stored in the data property, so var=obj.Data is all you need (where obj is the handle to your uitable, probably something like app.table).

Iniciar sesión para comentar.

 Respuesta aceptada

Taylor
Taylor el 3 de Nov. de 2023
You can use public properties to access variables from an app outside of an app.

1 comentario

Gustav
Gustav el 4 de Nov. de 2023
Thank you so much for this. So far the app is able to store values of the matrices from the uitable.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Preguntada:

el 3 de Nov. de 2023

Comentada:

el 4 de Nov. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by