Inputting a Matrix into a function
显示 更早的评论
I'm trying to calculate the kernel coefficient for volume scattering by inputting a range of values for t1r and g into my kvol variable.
how would i create a matrix for kvol that is in terms of my other matrices, t1r and g?

回答(2 个)
t0 = 0.5235;
t1d = 0:60;
t1r = deg2rad(t1d);% use this function to convert to radians
phi = pi;
g = cos(t0)*cos(t1r) + sin(t0)*sin(t1r)*cos(phi)
kvol = ((0.5*pi-g).*cos(g)+sin(g))./(cos(t0)+cos(t1r)) - (pi/4)
plot(kvol)
Use
kvol = (((0.5*pi-g).*cos(g)+sin(g))./(cos(t0)+cos(t1r))) - pi/4
instead of
kvol = (((0.5*pi-g)*cos(g)+sin(g))/(cos(t0)+cos(t1r))) - (pi/4)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
