You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
799 B

function [result]=kplot(x,y)
//
// plot(x,y) - plots rows y versus rows x, or rows y versus vector x
// plot(x) - simply rows x
//
[out, in]=argn(0)
// kremoveall();
if in==1 then
[xrows xcols] = size(x);
for k=1:xrows
dataset = kadd(0);
ksetmatrix(dataset,1,x(k,:)'); // simply rows x, k-1 is used instead of dataset
end
result = 1;
elseif in==2 then
[xrows xcols] = size(x);
[yrows ycols] = size(y);
for k=1:yrows
dataset = kadd(0);
if k<=xrows then
ksetmatrix(dataset,0,x(k,:)') // rows x
else
ksetmatrix(dataset,0,x(1,:)') // single vector x for all y rows
end
ksetmatrix(dataset,1,y(k,:)'); // versus rows y, k-1 is used instead of dataset
end
result = 1;
else
error("Wrong number of arguments !");
result = 0;
end