I need to plot multiple functions in one plot, in one figure, within a for loop
7 次查看(过去 30 天)
显示 更早的评论
I need to plot multiple functions in one plot, in one figure, within a for loop. I've tried putting 'hold on' in a trillion different places in the for loop with no success.
X and Y are defined earlier in the code
X = [0.3, 0.5, 0.7, 2.5];
Y= [2, 4, 6, 8];

1 个评论
Bob Thompson
2020-3-5
For the record, it is better if you paste the code directly, instead of an image. That way we can just copy the text.
What is t?
I suspect that the issue is calling out 'figure' within the loop, which will specify a new figure each loop. Try moving that outside the loop.
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
