## 40 Reputation

17 years, 78 days

## Power set...

Maple

Hello everybody,

I have a list of 8 integers and I want to extract all the possible sublists of this list.

For example if the list is L:=[1,2,3,4,5,6,7,8] I want to extract

[1,3,5]



[2,3,7,8]

etc.

Is there a simple way to do that? Since there are 2^8=256 of such sublists, my idea was to

write a for i  from 1 to 256 and convert i to a binary number on each iteration, e.g, i =123

is the binary number 1111011, which would correspond to sub list

## Maple export graphics with loop...

Maple

Hi Everyone!

I want to export several Figures with Maple at the same time. I tried

with(plots):

for i from 1 to 5 do
interface(plotdevice=ps, plotoutput=`c:/test||i.eps`, plotoptions=`color,portrait,

noborder,width=16cm,height=12cm`);
plot(cos(i*x), x = -5..5);
interface(plotdevice=inline);

od:

but it did not work. How can I create one file per Figure?

Thanks a lot,

Bernardo

## Export data with a given display precisi...

Hello, I learned in this forum that if one wants to display the elements of a matrix up to 6 decimal figures one uses interface(displayprecision=6); But then I tried to export a matrix with ctrl+c / ctrl+v to another application and when I pasted it the matrix appeared with a different number of decimal figures. My question is: how do I export a matrix with a given number of decimal figures? Thanks, Bernardo

## Numerical integration...

Maple
Hello!

I´m Trying to do numerical integration for a function defined by a product of characteristic functions. I either receive the message " Error, (in unknown) too many levels of recursion " or "error, (in evalf/int) unable to handle singularity". What should I do?

f_1:=(x,y,z,w)->piecewise(x+w > 0 , 1);
f_2:=(x,y,z,w)->piecewise(x*w - y*z > 0,1);
f_3:=(x,y,z,w)->piecewise((x+w)^2 - 4*(x*w - y*z)<0,1);
prod:=(x,y,z,w)->f_1(x,y,z,w)*f_2(x,y,z,w)*f_3(x,y,z,w);

I want to integrate prod, with all four variables ranging from -1 to 1.

Thank you, Bernardo

 Page 1 of 1
﻿