How to stack-up multiple cases in z axis?
Show older comments
I would like to change multiplier term from 1 to 50 with a step of 1 and plot all the shaded area by stacking all the cases up in z axis. Different cases could have different shaded area color to distinguish.
clc
clear
x(1) = 0 ;
y(1) = 0 ;
multiplier = 50 ;
for i = 1 : 1 : 99
x(i+1) = i^2 ;
y(i+1) = multiplier * i ;
end
iv = 1:numel(x);
Lv = x <= y;
hold on
figure(1)
plot(x)
hold on
plot(y)
patch([iv(Lv) flip(iv(Lv))], [x(Lv) flip(y(Lv))], 'g')
grid on
3 Comments
Dyuman Joshi
on 28 Sep 2023
"plot all the shaded area by stacking all the cases up in z domain."
What is the manner of stacking?
Can you give an exaple of how the output should look like?
Aditya Zade
on 28 Sep 2023
Edited: Aditya Zade
on 28 Sep 2023
Aditya Zade
on 28 Sep 2023
Accepted Answer
More Answers (0)
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



