How do I plot an interval with this?

조회 수: 1 (최근 30일)
Charlotte Smith
Charlotte Smith 2021년 5월 1일
편집: VBBV 2021년 5월 2일
Hi, guys,
w = linspace(1,2,100);
p = dval(x,as,w);
plot(w,p)
I want to plot an interval by using this function.
But I got nonconformant arguments, how do i get this to work correctly?
I would appreciate it if someone could help me.
function s = dval(x, a, v)
n = length(a);
s = a(n);
for i = n-1:-1:1
s = s *(v-x(i))+a(i); % got errors here
end

답변 (1개)

VBBV
VBBV 2021년 5월 1일
%if true
function S = dval(x, a, v)
n = length(a);
s = a(n);
for i = n-1:-1:1
s = s.*(v-x(i))+a(i); % got errors here
end
Try this
  댓글 수: 3
Image Analyst
Image Analyst 2021년 5월 1일
Charlotte, can you then please "Accept this link" to give @VBBV reputation points for his efforts.
VBBV
VBBV 2021년 5월 1일
편집: VBBV 2021년 5월 2일
Thank you @Image Analyst

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by