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
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
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);
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??
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?
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 =)
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!
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
@@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.
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.
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)
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.
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
thanks very much. Excellent job...
Great contribution
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
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);
@@aRealAndHumanManThing I see. I have to convert it then. Thanks for clarifying 🙏
great vídeo
Hello
Can we somehow display the calculated plot without hitting a button?
yes when you run the program it directly shows the plot
Hello I want to make an ellipsoid in appdesigner can you give me some advices ?
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??
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"
Did you figure it out? Im curious since im about to start learning this and i felt this to be a common problem
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?
Great video! How can I animate the plot in the app designer UIAxes?
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?
Hi Ajeet,
You can define the read values as a function and call it every time you click on a refresh button for example.
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 =)
@Max Kase yup, I have been watching on InstaFlixxer for months myself :)
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!
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
Hello, Do you know how to load or open a .fig file in a axes?
how can I use complex numbers as input for the complex calculations
Can I plot more than one graph in the Same axes using the same push button?
Please help
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 ?
I think it's in his later tutorials
how to show many functions in the same axes? greetings!!
Thanks a lot for your vid. Maybe your x-axis is not correct (0~2pi other than 0~1).
Hi Hongchuan,
Thanks for watching Hongchuan and yes you are right it should be 0-2pi.
@@BenitoSebastian Thanks for your prompt reply. Can I use imagesc to show an image in UIAxes ?
@@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.
@@BenitoSebastian Thanks!
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.
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)
use plot(app.UIAxes,x,y); instead ... just putting plot(app.UIAxes,y); screws it up
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.
how can we find intercept:
'