Question
documentclass[border=5mm]{standalone} usepackage{pgfplots} pgfplotsset{compat=1.12} begin{document} begin{tikzpicture}[ % Define Normal Probability Function declare function={ normal(x,m,s) = 1/(2*s*sqrt(pi))*exp(-(x-m)^2/(2*s^2)); } ] begin{axis}[ no markers, domain=0:12, zmin=0, zmax=1, xmin=0, xmax=3,
\documentclass[border=5mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.12}
\begin{document}
\begin{tikzpicture}[ % Define Normal Probability Function
declare function={
normal(\x,\m,\s) = 1/(2*\s*sqrt(pi))*exp(-(\x-\m)^2/(2*\s^2));
}
]
\begin{axis}[
no markers,
domain=0:12,
zmin=0, zmax=1,
xmin=0, xmax=3,
samples=200,
samples y=0,
axis lines=middle,
xtick={0.5,1.5,2.5},
xmajorgrids,
xticklabels={},
ytick=\empty,
xticklabels={$x_1$, $x_2$, $x_3$},
ztick=\empty,
xlabel=$x$, xlabel style={at={(rel axis cs:1,0,0)}, anchor=west},
ylabel=$y$, ylabel style={at={(rel axis cs:0,1,0)}, anchor=south west},
zlabel=Probability density, zlabel style={at={(rel axis cs:0,0,0.5)}, rotate=90, anchor=south},
set layers
]
\addplot3 [samples=2, samples y=0, domain=0:3] (x, {1.5*(x-0.5)+3}, 0);
\addplot3 [cyan!50!black, thick] (0.5, x, {normal(x, 3, 0.5)});
\addplot3 [cyan!50!black, thick] (1.5, x, {normal(x, 4.5, 1)});
\addplot3 [cyan!50!black, thick] (2.5, x, {normal(x, 6, 1.5)});
\pgfplotsextra{
\begin{pgfonlayer}{axis background}
\draw [on layer=axis background] (0.5, 3, 0) -- (0.5, 3, {normal(0,0,0.5)}) (0.5,0,0) -- (0.5,12,0);
\draw (1.5, 4.5, 0) -- (1.5, 4.5, {normal(0,0,1)}) (1.5,0,0) -- (1.5,12,0);
\draw (2.5, 6, 0) -- (2.5, 6, {normal(0,0,1.5)}) (2.5,0,0) -- (2.5,12,0);
\end{pgfonlayer}
}
\end{axis}
\end{tikzpicture}
\end{document}
can anyone help me to convert this file into Matlab script file?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started