How to plot all data points on one graph
4 views (last 30 days)
Show older comments
Nicole Cichon
on 27 Sep 2020
Commented: Nicole Cichon
on 27 Sep 2020
This is my code so far:
for R = [0.8 0.85 0.9 0.95 0.99]
y = 3;
high3 = 1-((1-R^y)^2)
end
% n=4
for R = [0.8 0.85 0.9 0.95 0.99]
y = 4;
high4 = 1-((1-R^y)^2)
end
%n=5
for R = [0.8 0.85 0.9 0.95 0.99]
y = 5;
high5 = 1-((1-R^y)^2)
end
% n = 3
for R = [0.8 0.85 0.9 0.95 0.99]
y = 3;
low3 = (1-(1-R)^2)^y
end
% n = 4
for R = [0.8 0.85 0.9 0.95 0.99]
y = 4;
low4 = (1-(1-R)^2)^y
end
% n = 5
for R = [0.8 0.85 0.9 0.95 0.99]
y = 5;
low5 = (1-(1-R)^2)^y
end
Each loop's output is five different numbers. I want all the outputs to be plotted on one plot. How do I do this?
0 Comments
Accepted Answer
madhan ravi
on 27 Sep 2020
R = [0.8 0.85 0.9 0.95 0.99];
y = 1 : numel(R);
high = 1-((1-R.^y).^2);
plot(R, y) % follow the same for low
More Answers (0)
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!