vs140580

495 Reputation

8 Badges

5 years, 41 days

MaplePrimes Activity


These are questions asked by vs140580

How to sort a matrix based on one particular column in that matrix

 

Matrix ([[21,30],[8,4]]).  Has to sorted on column one only and output. Matrix ([[8,4],[21,30]]). In this I have given only 2×2  it could be a n×n

Without too much code

 

 

I want to insert each row at a time into a excel sheet from a maple code .  But i dont want a new excel file created for each insert.

First my list L has say [(a,1),(a,2),(a,3),.....,(a,100)] 100 elements this is first i insert it into my excel first row
next  [(b,1),(b,2),(a,3),.....,(b,100)] 100 elements i should insert into excel second row and so on

but dont want to store them here on a rtable, vector,array "all together" then export

I justt store 1 row at a time insert it and do on the same excel file file dynamically. without creating multiple copies of the same file

can anyone help with a code using exceltools package or any

 

Suppose i have a set say

 

A={{"1"."8"},{"1","4"},{"1","10"}}

if i want to convert A to set such that {"{"1"."8"}","{"1","4"}","{"1","10"}"}  where each element is a string with minium time I have given a small set here i may have set with 48 to 100 such element that is s set of sets i want to convert the inside sets to strings without much of looping in minimum time can any one help

For example the below is a c code how to write this in maple

 

void swap(int *a, int *b)

 {

     int temp;

emp = *a;

*a = *b;    

 *b = temp;  

}    //permutation function

 void permutation(int *arr, int start, int end)

 {      

if(start==end)

     {        

 printarray(arr, end+1);

         return;    

 }      

int i;    

 for(i=start;i<=end;i++)  

   {          //swapping numbers      

   swap((arr+i), (arr+start));      

   //fixing one first digit          //and calling permutation on          //the rest of the digits          permutation(arr, start+1, end);          swap((arr+i), (arr+start));  

   }  

}

Kind help with a maple code without using the permute function maple such that I that can get each permutation at a time and as I do not want to store all the permutations in a list as it would require too much memory space when n is larger. So I would like to

say I have to permute [1,2,3] first I get 1,2,3 leave it , next get 2,1,3 leave it, 3,2,1 leave it and so I don't store them after using it.

the same way for combinations too without using the combinat to store entire in a list i want say choose from 1,2,3,4 say 3 elements at a time I choose 1,2,3 leave it next I choose say 1,2,4 leave it without storing after I have just used it

kind help please

First 22 23 24 25 Page 24 of 25