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)

답변 (1개)

dpb
dpb 2014년 3월 16일

0 개 추천

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.

질문:

2014년 3월 16일

답변:

dpb
2014년 3월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by