MATLAB: How to write a function functionmatlab functionxlswrite Please anyone can help me write this following function in matlab Best Answer The syntax for declaring a function in MATLAB is: function [y1,...,yN] = myfun(x1,...,xM)In your case, the function defintion would be: function v = func_name(m, g, k, t, r) v = ((m*g)/k)^0.5 * (1 - exp(-t/r))./(1+exp(-t/r));endFor further reference on writing functions: https://www.mathworks.com/help/matlab/ref/function.html Related SolutionsMATLAB: How to write a function for fectorial You might find the cumprod (link) function helpful. MATLAB: Error with plotting a function K = 10;r = .1;t = 0:1:100;solution1 = @(t,y) K .^ (1 - (exp(-t*r)));plot(t,(K.^(1 - (exp(t*r*-1)))), '-b'); Related QuestionI want to Plot the solution of velocityWhich plotting function can give me this curvePlot for specific vibrational heat
Best Answer