MATLAB AppDesigner | Tutorial 19 | Searching and Filtering data in a table

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 พ.ย. 2024

ความคิดเห็น • 55

  • @CarlosRodriguez-xk9ot
    @CarlosRodriguez-xk9ot 2 ปีที่แล้ว

    tables, searching and working with data is the core of engineering apps never seen something so more dedicated to working with data in guis, keep it up

  • @user-gi6hl1jc1q
    @user-gi6hl1jc1q 4 ปีที่แล้ว +5

    Like you're series very much. Wish they had been available many years ago.
    Tip for deleting array rows or columns and still using loops. Count backwards instead of forward and you can leave out the 'k' counting variable. E.g.-
    fAge = app.FilterAgeEditField.Value;
    nRows = size(app.UITable.Data,1);
    for i=nRows:-1:1
    if app.UITable.Data(i,2) > fAge
    app.UITable.Data(i,:) = [];
    end
    end
    A more elegant method is to use vectorization. E.g. -
    fAge = app.FilterAgeEditField.Value;
    % Create a boolean vector array
    % index that matches size,1 of table
    idx = app.UITable.Data(:,2) > fAge;
    % Use index to select/delete all rows
    % greater than the age criteria.
    app.UITable.Data(idx,:) = [];

  • @slapshot269
    @slapshot269 4 ปีที่แล้ว

    Thanks for explaining even the subtle things like curly/square brackets as you go along. A lot of videos gloss over those details, but they are great to know while building a good foundation

  • @sarahadamo3677
    @sarahadamo3677 4 ปีที่แล้ว +4

    Thank you for sharing your knowledge, it has been very helpful!

  • @cleydsonadller4802
    @cleydsonadller4802 4 ปีที่แล้ว +1

    You are a great teacher! Thank you very much Benito!

  • @werferrios1540
    @werferrios1540 4 ปีที่แล้ว +2

    Grrrrwwwwwweat job with the entire series. This is such a precise and concise dissemination of knowledge. Helpful Tips.

  • @enguantan9926
    @enguantan9926 4 ปีที่แล้ว +5

    Hey Sebastian I really really appreciate that you made a video to answer our questions. I can't thank you enough for all the useful information that you have given and I am able to finish my final year project because of you. Keep doing what you're doing, you're the best! Will continue to support your channel! :)

    • @BenitoSebastian
      @BenitoSebastian  4 ปีที่แล้ว +1

      Hey Samuel,
      I am really happy to hear that! I am glad I could help you in time. Please share my channel with you friends and colleagues.Thank you and all the best!

    • @enguantan9926
      @enguantan9926 4 ปีที่แล้ว +1

      I got a question Benito, for the k=k+1 part, after the row of Milner is looped, k will be 4 by then, but the number of rows to be deleted is only three (the matrix of of RowstoDel is a 1x3 matrix). So that means even though we want matlab to create a 1X4 matrix but if we do not put in a value into the fourth column, matlab will automatically ignore the fourth column and produce a 1X3 matrix?

    • @enguantan9926
      @enguantan9926 4 ปีที่แล้ว

      @@BenitoSebastian Sure thing! :D

    • @BenitoSebastian
      @BenitoSebastian  4 ปีที่แล้ว +1

      @@enguantan9926 So after Matlab adds 4 (Milner's row number) to the 3rd column in the RowstoDel vector, it will increment k. The value of k is now 4 however, a 4th column is only added to the RowstoDel vector only when the if condition is satisfied again. This means when we get to Row 5 (James) we skip adding the 4th column to the RowstoDel row vector because the if condition is not satisfied. Does that make sense?

    • @enguantan9926
      @enguantan9926 4 ปีที่แล้ว +1

      @@BenitoSebastian Alright, got it, thank you!! :D

  • @brucedickson6019
    @brucedickson6019 4 ปีที่แล้ว +5

    This is a great series, Benito! I've learned a fair bit about AppDesigner so thank you for your generosity. Can I suggest though that you re-label the Min Age to Max Age? (... presumably the minimum age would remove people from the list who are younger than the minimum.)

    • @BenitoSebastian
      @BenitoSebastian  4 ปีที่แล้ว +2

      Hi Bruce,
      Thankyou for the feedback, I am very glad to hear my videos were helpful. You are correct about my wording, I should have used Max age (apologies) but hopefully my explanation should avoid any confusion.
      Thanks,
      Benito

  • @OMARELMZOURI-d2l
    @OMARELMZOURI-d2l ปีที่แล้ว

    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 "?

  • @charalambosxydas2974
    @charalambosxydas2974 4 ปีที่แล้ว +1

    Hey
    Your videos have been very helpful. Could please make a video on multiple window applications? That would be very helpful for future use. Hope you see this.

  • @zainalabidin9171
    @zainalabidin9171 3 ปีที่แล้ว +1

    Hi Benito. As always, nice and clear explanation. Another way to make the first code work, is that you can use decrement instead of increment like this. It will solve the problem at 4:45
    for i = numrows:-1:1

  • @ngusemekonen8384
    @ngusemekonen8384 4 ปีที่แล้ว +1

    Benito Sebastian, Thank you very much! your videos are very clear and easy to follow keep going bro good job!

    • @BenitoSebastian
      @BenitoSebastian  4 ปีที่แล้ว

      Thank Nguse for commenting, subscribe to my channel if you already haven't. Thank you! :)

  • @jean-pierregieryn5525
    @jean-pierregieryn5525 ปีที่แล้ว

    Thank you. Please do more app designer tutorials

  • @jiajingli9765
    @jiajingli9765 4 ปีที่แล้ว +1

    Hi Benito! Your videos really help me a lot! Could you made a video about DropDown component in APP DESIGNER? When you select different item in dropDown component, the different file could be uploaded.

  • @benha325
    @benha325 4 ปีที่แล้ว +1

    Hi Benito,
    Thank you for these videos, they are very helpful. Could you add a video on how to add a column of checkboxes? For example, if you take the average of all the ages and that gives you a result but unchecking a row removes players age from the average, thus recalculating. Would be much appreciated.
    Thank you!
    By the way, are you a Liverpool fan?

  • @ZdeněkFrána
    @ZdeněkFrána ปีที่แล้ว

    I would love to know how to delaete data from table multiple times. I mean filtr the data again anad again without error.
    Thanks you very much for your work. I love your content.

  • @dominicbrindanp9459
    @dominicbrindanp9459 2 ปีที่แล้ว

    I appreciate your effort in making things simple. I have one question. when I try to filter the max age of the table. The system thows error "Unrecognized function or variable 'RowstoDel'." How to tackle with errors like this. Once again thanks for creating contents like this.

  • @kestonsmith1354
    @kestonsmith1354 4 ปีที่แล้ว +2

    You have the best videos on matlab app design, it's easy to follow through. Keep up the good work

    • @BenitoSebastian
      @BenitoSebastian  4 ปีที่แล้ว +1

      Thanks Keston! Hope this video helped you to solve the problems you had.

  • @alborzjelvani3316
    @alborzjelvani3316 4 ปีที่แล้ว +1

    Thanks Benito for creating such detailed and useful Tutorials. Would you be able to create a Tutorial/comment on how to read one or more than one .m files in the AppDesigner? In addition, could you show/comment how user inputs in AppDesigner can be passed into an .m file? Thank you.

    • @BenitoSebastian
      @BenitoSebastian  4 ปีที่แล้ว

      Hi Alborz,
      Thanks for commenting. You can read in a function from an m file by simply copying in the function name from the script file. But just make sure you have app as one of you inputs in the function defined in matlab. For example:
      function [f] = newtonslaw(app,m,a)
      You can then call this function in any of your call backs.

  • @vinodmariyachar4669
    @vinodmariyachar4669 2 ปีที่แล้ว

    Benito you could have used deleterows=[deleterows i] to append instead of using another variable k.Also I think logical indexing would have avoided the loop as well..

  • @silassamuel4738
    @silassamuel4738 4 ปีที่แล้ว

    Thanks for the knowledge.. After applying desired filters to multiple variables on the table How do you extract the new reduced table ??

  • @pablodelgad2
    @pablodelgad2 4 ปีที่แล้ว +1

    Hey Benito, thank you for all your video tutorials, they have been very helpful. I was wondering whether you have an example for multiple windows applications, I have to create one but do not have any idea of how to do it. I would really appreciate if you can post a video about it or just send me an example of one. Regards

    • @BenitoSebastian
      @BenitoSebastian  4 ปีที่แล้ว

      Hi Pablo,
      Sorry for the late reply. I will be releasing a video on this very soon. Meanwhile you can have a look at this example : uk.mathworks.com/help/matlab/creating_guis/multiwindow-app-gui-in-app-designer.html

  • @muazmaali2996
    @muazmaali2996 ปีที่แล้ว

    Hi! :) I understood everything in this video until you began to add the letter k. Woudnt it be much easier to use a while loop for looping through the whole table..?

  • @LonleyGuns
    @LonleyGuns 4 ปีที่แล้ว +1

    Hi Benito Sebastian :) Could You please create tutorial about multi window apps? And another idea to use @functions for UI graphs plotting :)

  • @ThangNguyen-jm1nn
    @ThangNguyen-jm1nn 4 ปีที่แล้ว

    I appreciate that you made this video. I have a problem
    if app.UITable.Data{i,2} > filterAge
    ("Undefined function 'gt' for input arguments of type 'cell'.")
    RowstoDel(1,k) = i;
    k = k +1;
    I don't know how can I solve this one. Please help me to answer.
    Thanks a lot

  • @Ashlaneo12
    @Ashlaneo12 4 ปีที่แล้ว

    Hello Benito! Your tutorials are very helpful and I was wondering if you could help me with a problem I'm running into. How do you graph the filtered data from a table? It's for a project and we have all the data on one graph and one table but then we are supposed to separately graph data that has been filtered from a loop callback. Thank You!

  • @marklukas3613
    @marklukas3613 3 ปีที่แล้ว

    Thanks for the video. My only question for you is how do you filter a table the same way when it is not numbers but text. I created a database where the user can search and add to a table with numbers and text. I have it working perfectly to filter numeric the same way you just showed, but I can not get the text filter to work right. Ex. If in the search box they enter a part number which contains numbers and letters (CA4820348239BTL) the only rows left are the ones that satisfy the search input. I have been looking all over for this answer if you could help me i would greatly appreciate it. Thanks for your help.

  • @zhinasedqi6213
    @zhinasedqi6213 4 ปีที่แล้ว +1

    Hello, thanks for sharing this information I have a question, how can I make the table in the app editable, and when the user changes the data in the table it automatically is saved when the second time the user opens the app?

    • @BenitoSebastian
      @BenitoSebastian  4 ปีที่แล้ว

      Hi Zhina,
      You can use the writetable function to update existing values in an excel sheet and then you can load it up on the startup function.
      Here is a link to the function:
      uk.mathworks.com/help/matlab/ref/writetable.html
      All the best!

  • @eidercasado5953
    @eidercasado5953 4 ปีที่แล้ว

    Hello Benito!! How about filtering names instead of numbers? I'm trying to do it, but I've got an error (undefined function 'ne' for input arguments of type 'cell') My idea is to filter the names that are not repeated
    Undefined function 'ne' for input arguments of type 'cell'.
    Undefined function 'ne' for input arguments of type 'cell'.
    Undefined function 'ne' for input arguments of type 'cell'.

  • @orlandob8182
    @orlandob8182 4 ปีที่แล้ว +1

    Hey Benito, great video btw, can you help me out? I need to change the format of the numbers in my UItable, but i dont know how, I dont wanna mess with the existing code, of the App, is there a way to change that ?

    • @BenitoSebastian
      @BenitoSebastian  4 ปีที่แล้ว

      Hey Orlando,
      What format are you trying to put it in? If you are trying reduce the number of decimal places, you can use round() function for example.

    • @orlandob8182
      @orlandob8182 4 ปีที่แล้ว +1

      Benito Sebastian im trying to add decimals and remove scientific notation I think app.UITable.ColumnFormat works

    • @BenitoSebastian
      @BenitoSebastian  4 ปีที่แล้ว

      @@orlandob8182 To add decimals you can use the function > format long.

  • @MissSarlot
    @MissSarlot 4 ปีที่แล้ว

    Hello, thanks for sharing your knowledge, not so many people do that. I would like to have a question, when I use your code it sayes Undefined function or variable 'RowstoDel'. How is this possible?

    • @MissSarlot
      @MissSarlot 4 ปีที่แล้ว

      ​@anass jr I figured out what to do. I need to convert filterAge from char array to num so I used str2num and now its work. But I don't understand why I must to do, while in video not.

  • @quadriquadri1655
    @quadriquadri1655 4 ปีที่แล้ว

    Hi sir I have a
    I am using the GUI program in MatLab so I have to design an RLC circuit so when the user enters the value of R, L and C right but I have to how It displays the type of filter it is (low pass, high pass, etc.) for will be the code for that? can you help
    thank you

  • @krutikgujarathi1554
    @krutikgujarathi1554 3 ปีที่แล้ว

    Hi sir can you please suggest how can i save the uitable data in Excel format in MATLAB app designer by clicking save button and how to update the data by run the application save again to same exel file .
    Please suggest as early as possible .
    Thank you !

    • @krutikgujarathi1554
      @krutikgujarathi1554 3 ปีที่แล้ว

      Because I have tried many times but not getting me

  • @cristian6234
    @cristian6234 3 ปีที่แล้ว

    Hello, Benito. I hope you doing very well.
    Benito, I have a problem with the Table component in app designer. I cannot display information after filtering. When I use the command app.UITable.Data after filtering, the table turn empty and doesn't display any information. I don't know if it's possible because the MATLAB version. I'm using R2021a and maybe has modifications.
    ¿Do you know how to solve this problem?

  • @amirazadehranjbar6844
    @amirazadehranjbar6844 2 ปีที่แล้ว

    you can use :
    data=data(data.Age>45,:);
    This method is much better and more efficient

  • @mp9305
    @mp9305 4 ปีที่แล้ว

    How about only filtering the "view" of the table, not actually deleting the rows... I don't want to lose any of the original data, e.g. the user can filter ages > 23, then type in 25 and see players with age > 25 instead, without having to read in the source data again.

  • @VerneKonig
    @VerneKonig 7 หลายเดือนก่อน

    Painful