R/mpCart.R

mpCart <-
function (M1=NULL, M2=NULL) {
     if ( is.null(M1) ) stop("The first parameter is missing")
     if ( is.null(M2) ) stop("The second parameter is missing")
     M12<-list();k<-0;
     for (i in 1:length(M1) ) {
          for (j in 1:length(M2) ){
              k<-k+1;M12[[k]]<-list(); 
              M12[[k]][[1]] <- c( M1[[i]][[1]], M2[[j]][[1]] );
              M12[[k]][2]   <- M1[[i]][[2]]*M2[[j]][[2]] ;
    }}
  return(M12);
}

Try the kStatistics package in your browser

Any scripts or data that you put into this service are public.

kStatistics documentation built on June 8, 2022, 5:05 p.m.