Filter löschen
Filter löschen

??? Undefined function or method 'dsip' for input arguments of type 'double'.

1 Ansicht (letzte 30 Tage)
Abdulaziz
Abdulaziz am 9 Apr. 2012
Hi guys, When i try to run this code i get an error says: ??? Undefined function or method 'dsip' for input arguments of type 'double'.
syms x x1 x2 x3 x4 x5 x6 x7
i=1;
for j=0:2/6:2
x(i)=j;
i=i+1;
end
for k=1:1:7
l(k)=1;
for n=1:1:7
if n~=k;
l(k)=l(k)*((x-x(n))/(x(k)-x(n)));
end
dsip(l(k));
end
and if i just delete the disp function I get an other error says: ??? In an assignment A(I) = B, the number of elements in B and I must be the same. end

Antworten (2)

Sean de Wolski
Sean de Wolski am 9 Apr. 2012
Are you by any chance looking for disp rather than dsip?
Also, I recommend avoiding using l (lower-case L) as a variable since it looks like a 1 or an l and this can frequently cause confusion. I think this might be the source of your other error as well.

Wayne King
Wayne King am 9 Apr. 2012
Did you mean disp()?
For your other error:
You have
l(k)=l(k)*((x-x(n))/(x(k)-x(n)));
But x is not a scalar. You are making the following mistake
x(1) = zeros(2,1);
  1 Kommentar
Abdulaziz
Abdulaziz am 9 Apr. 2012
thank you I made mistake in printing disp.
But x(n) and x(k) has a values and I want to keep x as a variable.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

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

Start Hunting!

Translated by