B-Spline Basic Matrix Error in line 21 when i am executing and the error is Error using bspline_basismatrix (line 25) Not enough input arguments.

14 views (last 30 days)
function [B,x] = bspline_basismatrix(n,t,x)
% B-spline basis function value matrix B(n) for x.
%
% Input arguments:
% n:
% B-spline order (2 for linear, 3 for quadratic, etc.)
% t:
% knot vector
% x (optional):
% an m-dimensional vector of values where the basis function is to be
% evaluated
%
% Output arguments:
% B:
% a matrix of m rows and numel(t)-n columns
% Copyright 2010 Levente Hunyadi
if nargin > 2
B = zeros(numel(x),numel(t)-n);
for j = 0 : numel(t)-n-1
B(:,j+1) = bspline_basis(j,n,t,x);
end
else
[b,x] = bspline_basis(0,n,t);
B = zeros(numel(x),numel(t)-n);
B(:,1) = b;
for j = 1 : numel(t)-n-1
B(:,j+1) = bspline_basis(j,n,t,x);
end
end

Answers (1)

KALYAN ACHARJYA
KALYAN ACHARJYA on 19 Dec 2020
This is custom function, you may call the function by passing necessary inputs arguments as defined in the input arguments list. Like the following way (Can call the same from command window)
>> [out1,out2]=bspline_basismatrix(2,rand(4,5))
Here t is optional, please read the details about inputs data, which is well defined within the function. Note that there are another custom function in the function file, which is bspline_basis. Save the both function file in current working directory with same name like bspline_basismatrix.m and bspline_basis.m. And later call it from another Matlab script by passing necessary input arguments.
Please refer more here

Community Treasure Hunt

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

Start Hunting!