MATLAB Answers

Minor mistake Writing a function but error

조회 수: 1(최근 30일)
Jhonie Habimana
Jhonie Habimana 2020년 11월 25일
댓글: Walter Roberson 2020년 11월 25일
Hello just a quick question, I am writing a code but an error keeps poping up for the function I entered
By any chance would you know why it keeps coming up as a red warning
f=@ (1./x)+(sqrt(x).*exp(x));


VBBV 2020년 11월 25일
%if true
f = @(x) (1/x)+(sqrt(x)*exp(x))
  댓글 수: 2
Walter Roberson
Walter Roberson 2020년 11월 25일
f = @(x) (1./x)+(sqrt(x).*exp(x))
as the original was vectorized

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by