![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/286277/image.png)
How can I plot this figure using MATLAB?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Kyle Dalminton
am 21 Apr. 2020
Kommentiert: darova
am 22 Apr. 2020
Dear experts.
I am not a MATLAB user myself but a portion of my work requires me to plot figures on MATLAB. I am unable to figure this out and google was not any help. I would be grateful if somebody gives me a clue about how to plot this figure? I would like to use this figure as my starting point to carry on my practice.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/286105/image.png)
I wish you a good day
0 Kommentare
Akzeptierte Antwort
darova
am 21 Apr. 2020
Here is patch use
x = 0:0.1:1;
y = sqrt(x);
cla
patch([0 0 0],[0 1 0],[0 0 1],'b') % vertical triangle
patch([1 0 x],[1 1 y],[0 0 x*0],'b') % horizontal triangle
patch([1 0 x],[1 1 y],[0 0 1-y],'b') % diagonal triangle
% use for loop to create cylindrical part
for i = 1:length(x)-1
dx = x(i:i+1);
dy = y(i:i+1);
patch([dx flip(dx)],[dy flip(dy)],[1-dy 0 0],'b')
end
alpha(0.5)
axis vis3d
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/286277/image.png)
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Lighting, Transparency, and Shading finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!