MATLAB AppDesigner | Tutorial 9 | Plotting a graph using axes

Поделиться
HTML-код
  • Опубликовано: 13 окт 2024

Комментарии • 37

  • @AmeenAlfiza
    @AmeenAlfiza 11 месяцев назад +3

    Thanks for the videos, I think there was a tiny mistake in using the plot function.. I think the right way of using it is this:
    ........
    function PlotButtonPushed(app, event)
    x = 0:0.01:2*pi;
    y = sin(x);
    plot(app.UIAxes,x,y)
    end

  • @lestercano3312
    @lestercano3312 Месяц назад

    thanks very much. Excellent job...

  • @lecturesoncontrolandautoma7777
    @lecturesoncontrolandautoma7777 4 года назад +1

    Great contribution

  • @dioutoroo
    @dioutoroo 2 года назад +1

    Hi Benito,
    Thanks for your tutorial. I have question, on your plot the x-axis does not exactly represent from 0 to 2xpi, does it? E.g., the value 1 on the y-axis does not show 90 degree value on the x-axis. Can you explain? Thank you

    • @aRealAndHumanManThing
      @aRealAndHumanManThing 10 месяцев назад +1

      If you want the function to have the value 1 at x=90, you'd have to add a converter to degrees. With radians, 90° is Pi/2 which is ~1.57. The Plot reaches y=1 at x=157 or 1.57 (1.57 when using "plot(app.UIAxes,x,y)"), so it's technically correct.
      You can use the following code to get an approximated plot for x in °:
      x = 0:360;
      y = sin(x*0.01745);
      plot(app.UIAxes,x,y);

    • @dioutoroo
      @dioutoroo 10 месяцев назад

      @@aRealAndHumanManThing I see. I have to convert it then. Thanks for clarifying 🙏

  • @convolucion1981
    @convolucion1981 4 года назад +1

    great vídeo

  • @autumn_405
    @autumn_405 2 года назад +2

    Hello
    Can we somehow display the calculated plot without hitting a button?

    • @Ahmedali-dw4pt
      @Ahmedali-dw4pt 2 года назад

      yes when you run the program it directly shows the plot

  • @kysayki
    @kysayki 2 года назад

    Hello I want to make an ellipsoid in appdesigner can you give me some advices ?

  • @b.conscious
    @b.conscious 4 года назад +2

    Hello! I keep getting an error when I try to run this app. the "plot(app.UIAxes,y)" line keeps gettin the error: 'Too many input arguments'. I even went to the mathworks website and copied and pasted their exact syntax for plotting in app designer and got the same error...how is this so??

    • @b.conscious
      @b.conscious 4 года назад +1

      also in the MATLAB console, it told me "function plot has the same name a MATLAB built in, suggest renaming the function to avoid name conflict"

    • @umaRFTW
      @umaRFTW 3 года назад

      Did you figure it out? Im curious since im about to start learning this and i felt this to be a common problem

  • @amadousow6598
    @amadousow6598 4 года назад

    Thx for the video i need help, i want use ginput on plot in app designer but i can't .Can you suggest me something?

  • @Pranavshashi
    @Pranavshashi 2 года назад

    Great video! How can I animate the plot in the app designer UIAxes?

  • @AjeetKumar-oc8sb
    @AjeetKumar-oc8sb 4 года назад +1

    Hello sir, I'm seeing your videos and these are quite useful. I have a different question. How can we add a refresh button in the app, so that if it is used to select a data file, and the file gets updated then It has the recent values? Can you please suggest any idea?

    • @BenitoSebastian
      @BenitoSebastian  4 года назад +1

      Hi Ajeet,
      You can define the read values as a function and call it every time you click on a refresh button for example.

    • @maxkase8166
      @maxkase8166 3 года назад

      You probably dont give a shit but if you guys are stoned like me atm then you can stream pretty much all of the new movies on InstaFlixxer. I've been watching with my brother lately =)

    • @ezrabaker2617
      @ezrabaker2617 3 года назад

      @Max Kase yup, I have been watching on InstaFlixxer for months myself :)

  • @SJP8Dominicans
    @SJP8Dominicans 4 года назад +1

    Hi Benito,
    I'm looking to run a graph plotting function from a separate .m file when a button is pressed in my app. I've figured out how to launch the .m file once the button is pressed but i'm a bit stuck on how to plot the graph from my function on the axes in the app itself.
    Would you be able to point me in the right direction for where to start with this?
    Thanks in advance!

    • @BenitoSebastian
      @BenitoSebastian  4 года назад +1

      Hi Neil,
      Thanks for your comment. If your script file is generating the x and y values for plotting, then you can use the evalin function in a callback in the appdesigner to read the x and y values into appdesigner from the workspace. For example in the call back function you would have the following :
      x = evalin("base",'x'); % Gets x data from workspace "base" means workspace
      y = evalin("base",'y'); % Gets y data from workspace
      plot(app.UIAxes,x,y); % Plots x against y
      Hope that helps, let me know if it works. All the best!
      Benito

  • @mianzhou2154
    @mianzhou2154 Год назад

    Hello, Do you know how to load or open a .fig file in a axes?

  • @vinaykvk1760
    @vinaykvk1760 3 года назад

    how can I use complex numbers as input for the complex calculations

  • @prithvianilkumar7314
    @prithvianilkumar7314 4 года назад

    Can I plot more than one graph in the Same axes using the same push button?
    Please help

  • @danielgrisedale7910
    @danielgrisedale7910 4 года назад +1

    Hello , I am wondering if it is possible to show the data from a scope from a simulink model into the axes in app designer ?

  • @javiseco4614
    @javiseco4614 2 года назад

    how to show many functions in the same axes? greetings!!

  • @fenghc1
    @fenghc1 4 года назад +1

    Thanks a lot for your vid. Maybe your x-axis is not correct (0~2pi other than 0~1).

    • @BenitoSebastian
      @BenitoSebastian  4 года назад

      Hi Hongchuan,
      Thanks for watching Hongchuan and yes you are right it should be 0-2pi.

    • @fenghc1
      @fenghc1 4 года назад +1

      @@BenitoSebastian Thanks for your prompt reply. Can I use imagesc to show an image in UIAxes ?

    • @BenitoSebastian
      @BenitoSebastian  4 года назад +2

      @@fenghc1 Yes, you can use the imshow function to display images in UIAxes. If you are using older versions of Matlab then you will have to replace a button with an image instead of UIaxes.

    • @fenghc1
      @fenghc1 4 года назад +1

      @@BenitoSebastian Thanks!

  • @MrSocialish
    @MrSocialish 3 года назад

    Is there a way to change the bounds of the plot? I don't want it to autofit the function because I can't get a clear view of the entirety of the signal (despite it being autofitted!). I've tried the xlim and ylim functions, but that just pulls up another figure outside of the GUI with the specified bounds.

    • @aRealAndHumanManThing
      @aRealAndHumanManThing 10 месяцев назад

      not sure how to do it exactly, but I think the best option would be to have an input prompt via EditField before plotting to get the correct data. You could set all the Limits in another function and maybe reduce the risk for bugs. (I know I'm a bit late but maybe this helps someone with a similar problem)

  • @TylerMatthewHarris
    @TylerMatthewHarris 3 года назад +1

    use plot(app.UIAxes,x,y); instead ... just putting plot(app.UIAxes,y); screws it up

  • @toyayaone5258
    @toyayaone5258 4 года назад

    Hi Benito, Thank you for these rich videos. I have sent you a e-mail , because I've difficulties in building an app, it gives me an error while running.

  • @gngh8160
    @gngh8160 4 года назад

    how can we find intercept:
    '