How to plot outputs from an equation with user inputs?
显示 更早的评论
I'm trying to plot a graph (xy-plot) in MATLAB GUI. I have coded an equation along with input boxes for user inputs (the variables). So after the user input the many variables the program will calculate the answers. I have time 1 and time 2 as a range for the plot in the x-drection. Now I want to code it so it will plot all the points between time 1 and time 2.
What is the best way to go about this in GUI?
2 个评论
Oleg Komarov
2011-8-29
Please delete your previous question since this duplicate it's better phrased.
Bastion
2011-8-29
采纳的回答
更多回答(2 个)
Oleg Komarov
2011-8-29
Let's say you have these two ranges:
time1 = now-9;
time2 = now;
% And you want to create 100 equispaced points on the range [time1 time2]
x = linspace(time1,time2,100);
y = f(x);
where f() is the equation you have coded, then plot:
plot(x,y)
If you don't what a specific function does, use the help or type in the command window:
doc functionName
Mohit Sharma
2016-10-1
0 个投票
sir please tell me that how to take input(Equation with range) from user and plot graph....
类别
在 帮助中心 和 File Exchange 中查找有关 Parametric Spectral Estimation 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!