Inputting a Matrix into a function
Ältere Kommentare anzeigen
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?

Antworten (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)
Kategorien
Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
