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.
28 lines
775 B
28 lines
775 B
function [result]=kcontour(x,y,z)
|
|
//
|
|
// kcontour(z) - plots contour
|
|
// kcontour(x,y,z) - plots contour versus x,y rows. x,y must be monotone
|
|
//
|
|
result=1
|
|
[out in]=argn(0)
|
|
if in==1 then
|
|
// kremoveall();
|
|
dataset = kadd(2);
|
|
ksetmatrix(dataset,2,x); // z
|
|
elseif in==3 then
|
|
kremoveall();
|
|
dataset = kadd(2);
|
|
if size(x,2) <> size(z,2) then, x=x', end
|
|
if size(y,1) <> size(z,1) then, y=y', end
|
|
|
|
if size(x,2) <> size(z,2) then, error("length(x) must be equal to cols(z) !"); result=0, end
|
|
if size(y,1) <> size(z,1) then, error("length(y) must be equal to rows(z) !"); result=0, end
|
|
|
|
ksetmatrix(dataset,0,x); // x
|
|
ksetmatrix(dataset,1,y); // y
|
|
ksetmatrix(dataset,2,z); // z
|
|
else
|
|
result = 0;
|
|
error("Wrong number of arguments !");
|
|
end
|
|
end |