casperyc

962 Reputation

10 Badges

16 years, 38 days
University of Kent
Dr

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are questions asked by casperyc

Hi all,

I have a problem with 'Rank' when trying to find the rank of a matrix.

For some purpose, I have to load both with(LinearAlgebra) and with(Statistics) packages.

Without using Statistics[Tally], (not loading the Statistics package), the Rank works fine.

With the Statistics package, Rank sometimes gives an error, saying,


Error, (in Statistics:-Rank) expected 1-dimensional Array, but .....

I now fix this by using LinearAlgebra[Rank].

Hi,

 

r:=[3,3,3,3,4,4,4,3,3,3,3,3,3,3,3,2,4,3,1];

 

What's the shortest way to create a frequency table from it?

 

Ie, tells me elements are 1,2,3,4

the corresponding counts are: 1,1,13 and 4

and then if it can return the number with highest counts: 3

Many thanks!

Casper

Hi all,

I read the help on using parameters, then I tried to modify the example


f := proc(a, b, c)

    if _params['b','c'] = NULL then
    a
    elif _params['c'] = NULL then
    a + b
    else
    a + b + c

    end if

end proc:

I can't really spot where it went wrong, but it just wouldnt execute as I would expect...

Hi all,

A := [[1,2],[3,4]];

A1:=convert(A, Matrix);

 

I am very happy with conversion between Matrices and Vectors.

However, I does not seem to be able to do this backwards to [row] or [column] Vectors???

Say how do I get back to A from A1???

 

I tried to use

convert(A1,Vector);

convert(A1,Vector[row]);

convert(A1,Vector[row],2);

 

And many others...

Hi all,

 

Toy example

myproc:=proc(a,b,c) a*b*c; end proc;

myproc(1,3,4);

myproc(2,3,4);

myproc(5,2,1);


is there a way to input all these together? say myproc({1,3,4},{2,3,4},{5,2,1});

and then get an ouput in the end (list, Vector, array or whatever sensible format)

I remember seeing an example of doing that somewhere, but couldnt find it again...

 

Thanks!

 

Casper

First 14 15 16 17 18 19 20 Last Page 16 of 31