Hi Benito - great tutorials. For reference, my version (2018a) kicks out an error if I use 'x Data' in the t.Properties.VariableNames{1} cell. 'x_Data' is completely fine, so it seems that this version does not permit spaces in the table content. Odd but it is Matlab...
Hi Bruce, Thanks for pointing this out, I have pinned your comment to the top anyone who is experiencing the same issue can see it first. Thank you once again.
Not sure if you guys gives a shit but if you are bored like me during the covid times then you can watch pretty much all the new movies and series on instaflixxer. Have been binge watching with my brother recently xD
Hi Benito. As always, nice and clear explanation. Can you please explain how we can make a gauge run automatically " linked the gauge to my Simulink model "?
Hi Benito, Best tutorials in the Matlab app designer series! Thank you for creating such good content. I seem to get the error 'Too many input arguments' when using readtable command. Any idea why this can happen? I've tried to find as many sources as possible. No solution.
I see that you can load an excel file if you have the name in but do you have the code that will allow me to pull up a directory and then load a file by clicking on it? Thank you.
Hi Benito, can you please explain me how to display the Name of Excel file in MATLAB app designer... For eg : I created one edit field text area , one button and table. Now I'm clicking the button my Excel table is read in the ui table and also I want to display the name of the Excel into the edit field text area.
I can see how to do this with excel from your example, but what about something similar for notepad? I want to design an app and do the following in order: 1. Either open notepad or some data entry box 2. Be able to input the data in the form of a matrix that matlab will read for variables 3. Be able to save the data to notepad. How would I do something like this?
Hello. I would like to plot some data from a table. The first colum is the time (to plot in x axis) then i would like to plot 3 diferent data from table columns in y axis. I also would like to have the initial and final data (for x axes) picked from 2 data pickers and plot the graph after.... Is this possible=?? thank you in advanced.
Hi Benito, I would like to know if there is any way to sort the data so that it is centered, because when I import the data, it is in the right part of the cell and I would like it to be centered. Greetings from Mexico
Hi Benito do you any idea why my matlab comes with errors when I'm using the readtable function. I have put the matlab script and the excel file in the same folder as each other as well and the matlab still generates an error. I am trying to get that data from the excel file into the matlab script and then plot a graph on matlab using the data afterwards trying to do the least squares method for a control module.
First of all, I would like to thank you for your video. It's really easy for me to follow. But I am facing a problem " While setting property 'Data' of class 'Table': Data must be a numeric, logical, or cell array" how could I solve this?
Hi ! In app designer, using a push button, I want to run a .m file (containing some variables ) and want to load them in workspace. In callback of Push button, what code should I write ?? please help
hi Benito, i have a question. I have a Data in a table and i m using an if to find a value, so im using if v(1,1)==72, c=13 end and at the end i want to put the information in another table. But it appears "Undefined function 'eq' for input arguments of type 'table'.". I dont know what im doing wrong.
Hi Paula, I believe you are trying to loop through data in a table and check if it is equal to 72 and if it is then set c = 13. This requires a couple of steps and my next tutorial (19) will show you how to do this. Meanwhile check out my tutorial 18 where I show you how to apply a conditional statement on data in a table.
Hi Benito I would like to thank you for your hard work. I am facing a problem if you can help me with it, I read data from excel to UITable using readtabel, then I want to add a drop down menu in column 4 (region) so the user can select the region then for each region selected in column 4 a corresponding value should appear in column 5. Lastly I want to multiply the value in column 5 with column 2 and display the value in column 6. I know its a bit complicated but is it possible to to so? I would appreciate the help.
Hi Benito. I have tried to change the value of 1 cell in a table and I don't seem to be able to do it. Seems you have to write the whole table at one time, you can't edit values in individual cells. What if you write to a table 3 rows by 3 cols, and you want to add a value to row 4, col 1 can you do it? I wish you could just write app.table.value(4,1) = newvalue; but this doesn't work. It's not really that user friendly. Another little thing is you can't justify the column names, it's always left justified.
Hi Ester, Matlab is probably the most user friendly coding package you can find, you just need to know how to define things correctly. To replace values in individual cells you need to do the following: >> % Based on the variables defined in this video tutorial >> t.x(1) = 99; % This will replace 1 in column 1 with 99 To add a new row of data you need to do the following: >> newrow = {'Benito', 185 , 10}; % New row should be defined as a cell array with curly brackets >> app.UITable.Data = [app.t;newrow]; % Then you need to add it to the previous table using concatenation This is a good question and I think many people are trying to do something similar.I will make a tutorial explaining how to do this properly. Look out for my next release!
Hi Benito, first of all thanks for making very brief and precise videos! They are so helpful! I have a question: so I wanted to create a button to import data using a dialog box (where I can choose any file). The callback function of this button is supposed to save the file name, the path and load the data on the variable A. I used the code below. So, this opens the dialog box but I can only choose Matlab files (even after choosing the option "All files")... but what I really want is to import csv files... Do you know how to fix this? Thanks in advance. function ButtonPushed(app, event)
Hi Benito, I have put in the code verbatim and I get the error: Error setting property 'Data' of class 'Table': (on line app.UITable.Data = t;) 1) I am using 2017B (on a MAC). 2) Created the data using excel (for a MAC) and stored. 3) Data stored in "t" looks fine in the Workspace Viewer. Searched the web, and no one appears to have run into this issue? Thanks for any help.
Hi Steven, What type of data are you trying to import? Some things to double check: 1. Make sure the capitals are used correctly. 2. Make sure the file is in the path 3. If none of these work you can try using xlsread as follows: t = xlsread("Book1.xlsx"); app.UITable.Data = t; All the best!
For anyone seeing my comment, I managed to do it by writing in the callback of the button: [filename, pathname]=uigetfile({'*.xlsx'},'File Selector'); text = readtable([pathname filename], "Sheet",1, 'ReadVariableNames',false); app.UITable.Data = text;
Hi Benito, is it possible to only extract specific data from excel? Like for example I only want to extract those data with x values larger than 5 and leave out the rest, sort of like a data filter. If not, how can I do that using app designer?
Hi Samuel, I think the best way to do this is to import the data into app designer and then loop through the each row and remove the rows you don't need. Once this is done then display the data on a table. All the best!
@@BenitoSebastian Thank you so much Benito. Can I ask you for one more favour? I posted a question on Mathworks, could you please spend a little time to look through the question? This is my final year project and I've been stuck at this step for a very long time and I really dont know who to go to, the info about appdesigner that I can find on the internet is really limited. Really hope you can help me if you have the time:) Thanks again.
@@BenitoSebastian oops sorry I forgot! heres the link: www.mathworks.com/matlabcentral/answers/503844-is-it-possible-to-filter-out-some-rows-in-a-table-using-appdesigner-callbacks Thank you very much!
Hi Benito. I would like to define an editable 3*m matrix in app designer programmatically defined by users. Once defined the parameter m in an editable field (numeric), the app automatically generates an editable 3*m matrix. How can I do this?
Hi Gaetano, From what I understand, what you can do is the following: 1. Create 3x3 numerica edit fields 2. Create a variable i.e. m = [app.editfield11.Value app.editfield12.Value app.editfield13.Value; app.editfield21.Value .... .... ; app.editfield21.Value .... .... ]; I hope you get the idea. All the best!
Hi Benito sir, actually while writing the same code for reading the data from the excel, its showing an error "unrecognised property 'data' for class 'matlab.ui.control.Table' Please help sir...
Hi Benito - great tutorials. For reference, my version (2018a) kicks out an error if I use 'x Data' in the t.Properties.VariableNames{1} cell. 'x_Data' is completely fine, so it seems that this version does not permit spaces in the table content. Odd but it is Matlab...
Hi Bruce,
Thanks for pointing this out, I have pinned your comment to the top anyone who is experiencing the same issue can see it first. Thank you once again.
It's not just spaces, 'x-Data' doesnt work either. But 'x_Data' works for me, so thank you
Not sure if you guys gives a shit but if you are bored like me during the covid times then you can watch pretty much all the new movies and series on instaflixxer. Have been binge watching with my brother recently xD
@Miles Isaac Yea, I've been watching on InstaFlixxer for since december myself :)
Benito, great tutorials! Very easy to follow, understand, and expand into more complex code. Keep them coming.
Thank you so much. I took a class in college for matlab but we never got to learn about app designing. Your tutorials are super helpful
Thanks Benito! These are really handy! Keep up the good work :)
Thanks for commenting Michael! :)
Very good
Hi Benito. As always, nice and clear explanation. Can you please explain how we can make a gauge run automatically " linked the gauge to my Simulink model "?
Ur tutorials are great. why dont u design an app for your tutorials
Hi Benito, Best tutorials in the Matlab app designer series! Thank you for creating such good content.
I seem to get the error 'Too many input arguments' when using readtable command. Any idea why this can happen? I've tried to find as many sources as possible. No solution.
I see that you can load an excel file if you have the name in but do you have the code that will allow me to pull up a directory and then load a file by clicking on it? Thank you.
Hi Benito. I wanted to know if I can display the contents of a .txt file onto a table?
Hi Benito, nice tutorials. Do you know how to load .mat file in App designer? I'm currently finding a way for that , so that I can plot data.
Hi Benito, can you please explain me how to display the Name of Excel file in MATLAB app designer...
For eg : I created one edit field text area , one button and table. Now I'm clicking the button my Excel table is read in the ui table and also I want to display the name of the Excel into the edit field text area.
I can see how to do this with excel from your example, but what about something similar for notepad? I want to design an app and do the following in order:
1. Either open notepad or some data entry box
2. Be able to input the data in the form of a matrix that matlab will read for variables
3. Be able to save the data to notepad.
How would I do something like this?
Hello. I would like to plot some data from a table. The first colum is the time (to plot in x axis) then i would like to plot 3 diferent data from table columns in y axis. I also would like to have the initial and final data (for x axes) picked from 2 data pickers and plot the graph after.... Is this possible=?? thank you in advanced.
Hi Benito, I would like to know if there is any way to sort the data so that it is centered, because when I import the data, it is in the right part of the cell and I would like it to be centered. Greetings from Mexico
How can we read data from a excel by browsing for the file?
Hi Benito do you any idea why my matlab comes with errors when I'm using the readtable function. I have put the matlab script and the excel file in the same folder as each other as well and the matlab still generates an error. I am trying to get that data from the excel file into the matlab script and then plot a graph on matlab using the data afterwards trying to do the least squares method for a control module.
First of all, I would like to thank you for your video. It's really easy for me to follow. But I am facing a problem " While setting property 'Data' of class 'Table':
Data must be a numeric, logical, or cell array" how could I solve this?
Hi, how can data from matlab save to excel like I do register a page that has a name, username, and password.
Hi !
In app designer, using a push button,
I want to run a .m file (containing some variables ) and want to load them in workspace.
In callback of Push button, what code should I write ??
please help
hi Benito, i have a question. I have a Data in a table and i m using an if to find a value, so im using if v(1,1)==72, c=13 end and at the end i want to put the information in another table. But it appears "Undefined function 'eq' for input arguments of type 'table'.". I dont know what im doing wrong.
Hi Paula,
I believe you are trying to loop through data in a table and check if it is equal to 72 and if it is then set c = 13. This requires a couple of steps and my next tutorial (19) will show you how to do this. Meanwhile check out my tutorial 18 where I show you how to apply a conditional statement on data in a table.
Hi Benito
I would like to thank you for your hard work.
I am facing a problem if you can help me with it, I read data from excel to UITable using readtabel, then I want to add a drop down menu in column 4 (region) so the user can select the region then for each region selected in column 4 a corresponding value should appear in column 5. Lastly I want to multiply the value in column 5 with column 2 and display the value in column 6.
I know its a bit complicated but is it possible to to so?
I would appreciate the help.
Hi Benito. I have tried to change the value of 1 cell in a table and I don't seem to be able to do it. Seems you have to write the whole table at one time, you can't edit values in individual cells. What if you write to a table 3 rows by 3 cols, and you want to add a value to row 4, col 1 can you do it? I wish you could just write app.table.value(4,1) = newvalue; but this doesn't work. It's not really that user friendly. Another little thing is you can't justify the column names, it's always left justified.
Hi Ester,
Matlab is probably the most user friendly coding package you can find, you just need to know how to define things correctly. To replace values in individual cells you need to do the following:
>> % Based on the variables defined in this video tutorial
>> t.x(1) = 99; % This will replace 1 in column 1 with 99
To add a new row of data you need to do the following:
>> newrow = {'Benito', 185 , 10}; % New row should be defined as a cell array with curly brackets
>> app.UITable.Data = [app.t;newrow]; % Then you need to add it to the previous table using concatenation
This is a good question and I think many people are trying to do something similar.I will make a tutorial explaining how to do this properly. Look out for my next release!
Hi Benito, first of all thanks for making very brief and precise videos! They are so helpful! I have a question: so I wanted to create a button to import data using a dialog box (where I can choose any file). The callback function of this button is supposed to save the file name, the path and load the data on the variable A. I used the code below. So, this opens the dialog box but I can only choose Matlab files (even after choosing the option "All files")... but what I really want is to import csv files... Do you know how to fix this? Thanks in advance.
function ButtonPushed(app, event)
Too many input arguments?? What to do with that
Hi Benito,
I have put in the code verbatim and I get the error:
Error setting property 'Data' of class 'Table': (on line app.UITable.Data = t;)
1) I am using 2017B (on a MAC).
2) Created the data using excel (for a MAC) and stored.
3) Data stored in "t" looks fine in the Workspace Viewer.
Searched the web, and no one appears to have run into this issue? Thanks for any help.
I stumbled across something that works: app.UITable.Data = table2cell(t)
Hi Steven,
What type of data are you trying to import?
Some things to double check:
1. Make sure the capitals are used correctly.
2. Make sure the file is in the path
3. If none of these work you can try using xlsread as follows:
t = xlsread("Book1.xlsx");
app.UITable.Data = t;
All the best!
@@BenitoSebastian This works! Thanks
Great video! Thank you
How do I attach any Excel file to a Matlab table and then use these values as a 2-column (x, y) matrix?
For anyone seeing my comment, I managed to do it by writing in the callback of the button:
[filename, pathname]=uigetfile({'*.xlsx'},'File Selector');
text = readtable([pathname filename], "Sheet",1, 'ReadVariableNames',false);
app.UITable.Data = text;
Hi Benito, is it possible to only extract specific data from excel? Like for example I only want to extract those data with x values larger than 5 and leave out the rest, sort of like a data filter. If not, how can I do that using app designer?
Hi Samuel,
I think the best way to do this is to import the data into app designer and then loop through the each row and remove the rows you don't need. Once this is done then display the data on a table.
All the best!
@@BenitoSebastian Thank you so much Benito. Can I ask you for one more favour? I posted a question on Mathworks, could you please spend a little time to look through the question? This is my final year project and I've been stuck at this step for a very long time and I really dont know who to go to, the info about appdesigner that I can find on the internet is really limited. Really hope you can help me if you have the time:) Thanks again.
@@enguantan9926 Can you give me the link to the question or post on my discussion page. Thanks!
@@BenitoSebastian oops sorry I forgot! heres the link: www.mathworks.com/matlabcentral/answers/503844-is-it-possible-to-filter-out-some-rows-in-a-table-using-appdesigner-callbacks
Thank you very much!
Hi Samuel,
Check out my new Tutorial 18, it will help you hopefully!
Hi Benito.
I would like to define an editable 3*m matrix in app designer programmatically defined by users.
Once defined the parameter m in an editable field (numeric), the app automatically generates an editable 3*m matrix.
How can I do this?
Hi Gaetano,
From what I understand, what you can do is the following:
1. Create 3x3 numerica edit fields
2. Create a variable i.e. m = [app.editfield11.Value app.editfield12.Value app.editfield13.Value;
app.editfield21.Value .... .... ;
app.editfield21.Value .... .... ];
I hope you get the idea. All the best!
Hi Benito sir, actually while writing the same code for reading the data from the excel, its showing an error "unrecognised property 'data' for class 'matlab.ui.control.Table'
Please help sir...
Hi Subham,
Please see my reply to Steven Gaj above.
If possible to make exe without matlab compiler??
Suppose you have a sheet with headers for each column.
Hi Benito, Do you speak spanish?
Hi Ronald,
Unfortunately no, I just have a Spanish/Italian name. :)
Sorry for the misunderstanding. I have a problem reading data from an excel sheet and I wanted to ask if you are willing to guide me
@@alfgue89 Hey Ronald,
No worries. What is the issue you are having with reading the file?