Not enough input arguments.

Hi!! im new on matlab and i have this problem today
I defined a vector x=linspace(-1,1.50) with 50 columns,
and then i want the output from this function f = cos(2*x+1)+x.^2+x.*sin(x)+(1/3)*exp(x/5) 50 numbers,
so i make this function
function [ f ] = funcion( x ) %UNTITLED Summary of this function goes here % Detailed explanation goes here f = cos(2*x+1)+x.^2+x.*sin(x)+(1/3)*exp(x/5)
but when i call it i get the error Not enough input arguments. at this line f = cos(2*x+1)+x.^2+x.*sin(x)+(1/3)*exp(x/5)

Answers (1)

dpb
dpb on 16 Mar 2014
function [ f ] = funcion( x )
f = cos(2*x+1)+x.^2+x.*sin(x)+(1/3)*exp(x/5);
Looks ok other than you're missing a dot operator on the term _(1/3).*exp(...)
Need error in context w/ the line that tried to call it.

Asked:

on 16 Mar 2014

Answered:

dpb
on 16 Mar 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!