My problem with simple function input in matlab? Error:Line -3

조회 수: 1 (최근 30일)
QP Robert
QP Robert 2012년 11월 13일
I am trying to input my function for integration, and every time I try and make a function and define it, I always get the same error, it says "???Error: Line: -3{??? Undefined function or variable 'x'" but when I input the same function in maple, the same exact way, I get no error, so what am I doing so wrong with matlab??
example function y = x+1;
matlab in return says
Version 7.12.0.635 (R2011a) 32-bit (glnx86)
???Error: Line: -3{??? Undefined function or variable 'x'.
y = x+1 }

채택된 답변

Casey
Casey 2012년 11월 13일
Maple and matlab have different syntax. see https://www.math.duke.edu//education/ccp/materials/diffeq/mlabtutor/mlabtut9.html for some good examples of how to integrate in matlab
  댓글 수: 2
QP Robert
QP Robert 2012년 11월 13일
thanks, thats exactly what I was missing, the argument of syms x, obviously my function is a little more complicated than y=x+1, but for ease of typing and ease of answer, i used the most basic function. Thanks for your very fast response and link!
QP Robert
QP Robert 2012년 11월 13일
my integral is actually (x^2-2*x-1)/(((x-1)^2)*(x^2+1)). I know I have a lot of (), but this way I dont lost track of where my arguments go. Thanks Again

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by