??? Undefined function or method 'dsip' for input arguments of type 'double'.
3 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(2 个)
Sean de Wolski
2012-4-9
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.
0 个评论
Wayne King
2012-4-9
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);
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!