Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

how to write this function code

조회 수: 4 (최근 30일)
marwan alamah
marwan alamah 2020년 6월 9일
마감: MATLAB Answer Bot 2021년 8월 20일
y(2.5)=3*x.^5+2*x.^3+x.^2+7

답변 (1개)

David Hill
David Hill 2020년 6월 9일
y=@(x)3*x.^5+2*x.^3+7;
y(2.5);
  댓글 수: 2
marwan alamah
marwan alamah 2020년 6월 9일
what should i write after ;
if i pressed enter there is no answer only after deleting it
David Hill
David Hill 2020년 6월 9일
y contains the function. You can evaluate y at any points you want and store the values in a different variable or default ans.
x=y(2.5);%x will now contain the value of the function y and 2.5
z=y(1:10);%z will by an array containing the values of y at 1,2,3,...10
display(x);%will display but you can just look at the work space to find the values as well

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by