Skip to content

Instantly share code, notes, and snippets.

@ceptreee
Created March 25, 2020 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ceptreee/554b767f000c39dc00e288c2e952df8e to your computer and use it in GitHub Desktop.
Save ceptreee/554b767f000c39dc00e288c2e952df8e to your computer and use it in GitHub Desktop.
function hoge(n)
if n == 1
Lt = 1.0
K = (t,s) -> 2.0 * cos( t - s )
g = (t) -> exp(t)
y_exc = (t) -> exp(t) * ( 1.0 + t )^2
elseif n == 2
Lt = 3.0
K = (t,s) -> (t-s)
g = (t) -> 1.0 - t - t^2/2.0
y_exc = (t) -> 1.0 - sinh(t)
end
return Lt,K,g,y_exc
end
@bicycle1885
Copy link

function hoge(n)
    Lt = n == 1 ? 1.0 : 3.0
    K(t, s) = n == 1 ? 2.0 * cos( t - s ) : (t-s)
    g(t) = n == 1 ? exp(t) : 1.0 - t - t^2/2.0
    # ...
    return Lt, K, g, y_exc
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment