How do I plot an interval with this?

1 visualización (últimos 30 días)
Charlotte Smith
Charlotte Smith el 1 de Mayo de 2021
Editada: VBBV el 2 de Mayo de 2021
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

Respuestas (1)

VBBV
VBBV el 1 de Mayo de 2021
%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 comentarios
Image Analyst
Image Analyst el 1 de Mayo de 2021
Charlotte, can you then please "Accept this link" to give @VBBV reputation points for his efforts.
VBBV
VBBV el 1 de Mayo de 2021
Editada: VBBV el 2 de Mayo de 2021
Thank you @Image Analyst

Iniciar sesión para comentar.

Categorías

Más información sobre Graphics Objects en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by