How to plot in UIAxes and demo of slider, knob and Gauge in App Designer in MATLAB.

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ก.ย. 2024
  • This video shows how to plot a voltage-current-resistance AC current equation in the MATLAB' App Designer tool.
    This video use the Slider, Knob, Gauge and UI Axes to demonstrate the plotting of the equation.
    Complete Source code is available at:
    programmerworl...
    We will be glad to hear from you regarding any query, suggestions or appreciations at: programmerworld1990@gmail.com

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

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

    this is one of the beast TH-cam channel that give full instructions of how to built an app

  • @juanpabloalvarezarteaga9653
    @juanpabloalvarezarteaga9653 2 ปีที่แล้ว +1

    This video is super usefull.
    Thank you, and greetings from Mexico!!!

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

    thanks man, I owe you, you saved my grade

  • @nelsoncastillo4506
    @nelsoncastillo4506 6 ปีที่แล้ว +1

    Thanks for this tutorial ,thanks from chile!!!!!

  • @samsam-un3cq
    @samsam-un3cq 4 ปีที่แล้ว +1

    thank you, it helps my project :)

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

    nice video...very helpful

  • @josemarioacosta1432
    @josemarioacosta1432 5 ปีที่แล้ว

    Cheers mate, you saved my life!

  • @adarshmishra6379
    @adarshmishra6379 6 ปีที่แล้ว

    nice video, short, simple and rich.

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

    great sir

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

    Good one to begin with 🙏

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

    Thanks!

  • @REDSLibrary
    @REDSLibrary 5 ปีที่แล้ว +1

    Very nice

  • @sahilchawla9339
    @sahilchawla9339 5 ปีที่แล้ว +1

    The video was highly informative but the number of ads in between were very frustrating. Anyway thanks for the tutorial.

    • @ProgrammerWorld
      @ProgrammerWorld  5 ปีที่แล้ว +1

      Thanks for your message. I will check for the number of breaks in the video. Thanks for highlighting this.

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

    @programmer world I got good info abt app developer tool present in MATLAB from your tutorial. I just need one information becoz I stucked while creating a project.
    In ur project after clicking start respected based on slider and knob values as output Volt. function is displayed. if we want to hold that plot again for next different inputs it's correcponding output to be displayed is there a way to do such thing mentioned as above.
    Thanks in advance❤️

  • @mahfuztalukdar5737
    @mahfuztalukdar5737 5 ปีที่แล้ว +1

    Thanks a lot

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

    Would you make a video from simulink block to appdesigner that have gauge as the output? I'm trying to follow your step but the output still cannot appear :(

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

    Can u tell me what I should I have to do if I need to take multiple points as input?

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

    Tankys

  • @saud674
    @saud674 5 ปีที่แล้ว +1

    Can you tell how to put images in axis in UIAxis?

    • @ProgrammerWorld
      @ProgrammerWorld  5 ปีที่แล้ว +1

      For images in App Designer, I have shown it in my below video where I have customized the buttons with images:
      How to design a simple Game in MATLAB using App Designer?
      th-cam.com/video/3IQMZQ7JBn0/w-d-xo.html
      Regarding images in axis, I don’t think that is possible. Axis is mainly for plotting graphs. So, I don’t think there is any use case for putting images in the Axes.
      If you want to display images in your GUI, you can use buttons as shown in my above video.

  • @bharatagarwal6330
    @bharatagarwal6330 6 ปีที่แล้ว

    Hi I am getting an error
    Error using uiaxes
    Too many input arguments.
    Error in uiaxes (line 109)
    createComponents(app)
    and when I press start button then i get
    Error using plot
    Parent must be a scalar graphics handle.
    Please suggest

    • @ProgrammerWorld
      @ProgrammerWorld  6 ปีที่แล้ว

      Most likely there is some issue with the plot command syntax you have used. Recheck it. Copy your Start button callback function and let me have a look.

    • @bharatagarwal6330
      @bharatagarwal6330 6 ปีที่แล้ว

      THETA=app.THETASlider.Value;
      freq=app.FrequencyKnob.Value;
      Ampl=app.AmplitudeSlider.Value;
      time=0:0.2:10;
      volt=Ampl*sin(freq*time+THETA);
      plot(app.UIAxes , time , volt);
      for i=1:length(volt)
      app.Gauge.Value=volt(i);
      pause(1);
      end

    • @ProgrammerWorld
      @ProgrammerWorld  6 ปีที่แล้ว

      Thanks for sharing the code. The callback function looks good. No issues here. From your error message 'Parent must be a scalar graphics handle' ... I suspect that your app.UIAxes is not created properly. I will have to ask you to share the complete code of App Designer. Then I can try to execute that in my environment.
      I am pasting a part of my code. Please note there is Create UIAxes details in the Private methods in the code. Anyway share the complete code and let me have a look.
      % App initialization and construction
      methods (Access = private)
      % Create UIFigure and components
      function createComponents(app)
      % Create UIFigure
      app.UIFigure = uifigure;
      app.UIFigure.Position = [100 100 640 480];
      app.UIFigure.Name = 'UI Figure';
      % Create UIAxes
      app.UIAxes = uiaxes(app.UIFigure);
      title(app.UIAxes, 'Title')
      xlabel(app.UIAxes, 'X')
      ylabel(app.UIAxes, 'Y')
      app.UIAxes.Position = [254 222 365 217];
      % Create ThetaSliderLabel
      app.ThetaSliderLabel = uilabel(app.UIFigure);
      app.ThetaSliderLabel.HorizontalAlignment = 'right';
      app.ThetaSliderLabel.VerticalAlignment = 'top';
      app.ThetaSliderLabel.Position = [24 424 36 15];
      app.ThetaSliderLabel.Text = 'Theta';
      .........................................

    • @bharatagarwal6330
      @bharatagarwal6330 6 ปีที่แล้ว

      classdef uiaxes < matlab.apps.AppBase
      % Properties that correspond to app components
      properties (Access = public)
      UIFigure matlab.ui.Figure
      STARTButton matlab.ui.control.Button
      FrequencyKnobLabel matlab.ui.control.Label
      FrequencyKnob matlab.ui.control.Knob
      THETASliderLabel matlab.ui.control.Label
      THETASlider matlab.ui.control.Slider
      AmplitudeSliderLabel matlab.ui.control.Label
      AmplitudeSlider matlab.ui.control.Slider
      UIAxes matlab.ui.control.UIAxes
      GaugeLabel matlab.ui.control.Label
      Gauge matlab.ui.control.SemicircularGauge
      end
      methods (Access = private)
      % Callback function: AmplitudeSlider, FrequencyKnob,
      % STARTButton, THETASlider
      function STARTButtonPushed(app, event)
      THETA=app.THETASlider.Value;
      freq=app.FrequencyKnob.Value;
      Ampl=app.AmplitudeSlider.Value;
      time=0:0.2:10;
      volt=Ampl*sin(freq*time+THETA);
      plot(app.UIAxes , time , volt);
      for i=1:length(volt)
      app.Gauge.Value=volt(i);
      pause(1);
      end
      end
      end
      % App initialization and construction
      methods (Access = private)
      % Create UIFigure and components
      function createComponents(app)
      % Create UIFigure
      app.UIFigure = uifigure;
      app.UIFigure.Position = [100 100 816 656];
      app.UIFigure.Name = 'UI Figure';
      % Create STARTButton
      app.STARTButton = uibutton(app.UIFigure, 'push');
      app.STARTButton.ButtonPushedFcn = createCallbackFcn(app, @STARTButtonPushed, true);
      app.STARTButton.Position = [359 64 100 22];
      app.STARTButton.Text = 'START';
      % Create FrequencyKnobLabel
      app.FrequencyKnobLabel = uilabel(app.UIFigure);
      app.FrequencyKnobLabel.HorizontalAlignment = 'center';
      app.FrequencyKnobLabel.Position = [119 303 63 15];
      app.FrequencyKnobLabel.Text = 'Frequency';
      % Create FrequencyKnob
      app.FrequencyKnob = uiknob(app.UIFigure, 'continuous');
      app.FrequencyKnob.Limits = [0 10];
      app.FrequencyKnob.ValueChangedFcn = createCallbackFcn(app, @STARTButtonPushed, true);
      app.FrequencyKnob.ValueChangingFcn = createCallbackFcn(app, @STARTButtonPushed, true);
      app.FrequencyKnob.Position = [120 352 60 60];
      app.FrequencyKnob.Value = 2;
      % Create THETASliderLabel
      app.THETASliderLabel = uilabel(app.UIFigure);
      app.THETASliderLabel.HorizontalAlignment = 'right';
      app.THETASliderLabel.Position = [40 577 44 15];
      app.THETASliderLabel.Text = 'THETA';
      % Create THETASlider
      app.THETASlider = uislider(app.UIFigure);
      app.THETASlider.Limits = [-90 90];
      app.THETASlider.ValueChangedFcn = createCallbackFcn(app, @STARTButtonPushed, true);
      app.THETASlider.ValueChangingFcn = createCallbackFcn(app, @STARTButtonPushed, true);
      app.THETASlider.Position = [105 583 150 3];
      % Create AmplitudeSliderLabel
      app.AmplitudeSliderLabel = uilabel(app.UIFigure);
      app.AmplitudeSliderLabel.HorizontalAlignment = 'right';
      app.AmplitudeSliderLabel.Position = [40 185 60 15];
      app.AmplitudeSliderLabel.Text = 'Amplitude';
      % Create AmplitudeSlider
      app.AmplitudeSlider = uislider(app.UIFigure);
      app.AmplitudeSlider.Limits = [0 20];
      app.AmplitudeSlider.ValueChangedFcn = createCallbackFcn(app, @STARTButtonPushed, true);
      app.AmplitudeSlider.ValueChangingFcn = createCallbackFcn(app, @STARTButtonPushed, true);
      app.AmplitudeSlider.Position = [121 191 150 3];
      app.AmplitudeSlider.Value = 5;
      % Create UIAxes
      app.UIAxes = uiaxes(app.UIFigure);
      title(app.UIAxes, 'Title')
      xlabel(app.UIAxes, 'X')
      ylabel(app.UIAxes, 'Y')
      app.UIAxes.Position = [433 434 300 185];
      % Create GaugeLabel
      app.GaugeLabel = uilabel(app.UIFigure);
      app.GaugeLabel.HorizontalAlignment = 'center';
      app.GaugeLabel.Position = [523 282 42 15];
      app.GaugeLabel.Text = 'Gauge';
      % Create Gauge
      app.Gauge = uigauge(app.UIFigure, 'semicircular');
      app.Gauge.Limits = [-20 20];
      app.Gauge.Position = [484 312 120 65];
      end
      end
      methods (Access = public)
      % Construct app
      function app = uiaxes
      % Create and configure components
      createComponents(app)
      % Register the app with App Designer
      registerApp(app, app.UIFigure)
      if nargout == 0
      clear app
      end
      end
      % Code that executes before app deletion
      function delete(app)
      % Delete UIFigure when app is deleted
      delete(app.UIFigure)
      end
      end
      end

    • @ProgrammerWorld
      @ProgrammerWorld  6 ปีที่แล้ว

      Your complete script looks good. And it runs on my machine correctly.
      So, now the only issues on your machine is due custom uiaxes.m or plot.m file which is over-shadowing the built-in function.
      Use below command which are your custom files and remove them from matlab path:
      which -all uiaxes
      which -all plot

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

    I don't find the app designer in my Matlab 2015

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

      I am not sure but I think App designer is relatively new feature of matlab. Try a later version say 2017 or 2018 version, you should be able to get App Designer.
      Good Luck
      Programmer World
      programmerworld.co
      -

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

    Would you make tutorial how to send video viewer simulink to appdesigner?

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

      I think you should refer to my below tutorials on this topic.
      Below video shows steps to create a video editor using AppDesigner in MATLAB:
      th-cam.com/video/0c2-IqeYmNw/w-d-xo.html
      However, below tutorial gives details on how to live-stream data using webcam.
      th-cam.com/video/xp3KtoWaGX8/w-d-xo.html
      Though none of these videos shows the steps to deal with Video Viewer block but I hope the above videos are helpful in designing video Apps in your AppDesigner.

  • @Stefan-ef1vv
    @Stefan-ef1vv 5 ปีที่แล้ว

    Can it update in real time?

    • @ProgrammerWorld
      @ProgrammerWorld  5 ปีที่แล้ว

      Could you please elaborate on what you mean by real time?
      If you mean to stream live data using something like data acquisition toolbox, then yes I think it should be possible to plot those data in chunks of time interval.
      However, if you mean to update the plot while gui application is running, then yes that is also possible. I think that is shown in my various videos on Matlab app designer topic.

  • @SaquibSattar007
    @SaquibSattar007 6 ปีที่แล้ว +1

    can you make videos on using global functions in app design and
    A room has two doors, one dedicated for entry and other for exit. A PIR sensor is placed at both the doors to monitor the movement of the people. Write a MATLAB code to dynamically count the number of occupants in the room. Assume that PIR sensors are connected to digital pin 8 and 9 of Arduino Uno which are dedicated for entry and exit doors respectively .
    An LED is connected to digital pin 9 of Arduino Uno. A distance measuring analog sensor that generates 0 to 5V is connected to analog pin A0 of Arduino Uno. Write a MATLAB program to vary the flickering frequency of the LED depending on the position of any object from the sensor.
    Develop a user interface which consist of a static text and a button. On click of the button, the color of the static text should randomly change
    Thanks :)

    • @ProgrammerWorld
      @ProgrammerWorld  6 ปีที่แล้ว

      I will be glad to help you out. Once I have some videos available as per your request, I will let you know.

    • @ProgrammerWorld
      @ProgrammerWorld  6 ปีที่แล้ว

      I have made a video which may help you with your above requirements. You can watch it at: th-cam.com/video/7Nn6DXfuEXs/w-d-xo.html