Gistlib Logo

gistlib

create the function x t = 3e −1.5t sin 2t cos 4t in matlab

You can create a function with the specified expression using the following code:

main.m
function [y] = xt(t)
    y = 3*exp(-1.5*t)*sin(2*t)*cos(4*t);
end
66 chars
4 lines

Save the file with any name (let's say myFunc.m) and call it from wherever you want by using myFunc(t).

similar matlab code snippets

how to calculate the range of a matrix in matlab
how to calculate the mean of a matrix in matlab
how to calculate the laplacian of a function in matlab
how to calculate the indefinite integral of a function in matlab
how to calculate the skewness of a vector in matlab
how to calculate the hessian of a function in matlab
how to calculate the fifth derivative of a function in matlab
how to calculate the fourth derivative of a function in matlab
how to calculate the correlation of two vectors in matlab
how to calculate the minimum of a vector in matlab

related categories

matlab
function

gistlibby LogSnag