MaplePrimes Questions

loock i have 3 models and a Matrix
>m3:=importmatrix("loslobos.txt");
>model[1]:=a*x;
>model[2]:=a^2*x+b;
>model[3]:=C-x^2+a;

so i apply a command named DataFit and it gives me 
>g:=Datafit(matrix,model[1]);

and that throws
         g:=[3,[a:=5],33];
so
         >g[1];
3
         >g[2];
5
         >g[3];
33
the variable that i care about is g[1] so every 3 models have differents g[1] so i need to pick the smallest g[1] and then use his model.
Example:=
>g:=Datafit(matrix,model[1]);
g:=[3,[a:=5],33];
>gg:=Datafit(matrix,model[2]);
gg:=[10,[a:=5,b:=10],44];
>G:=Datafit(matrix,model[3]);
G:=[1.1,[C:=5,a:=2],88];

then 

>plots:-display(plot(m3, style = point, symbol = diamond, symbolsize = 9), plot(eval("MODEL THAT SHOULD BE PLOT", THE G[2] OF THE MODEL), x = 0 .. 27, color = black));

The right one here would be 

>plots:-display(plot(m3, style = point, symbol = diamond, symbolsize = 9), plot(eval(model[3], G[2]), x = 0 .. 27, color = black));

so how do i select the model[3] for my plot? i knnow how the eval works so the problem here is to pick the right model please Help i hope that i isn't that Hard thnx
   

i need to find how many rows and how many columns has a matrix that i just imported so i don't have to use readstat so it will be more automatic.

m1 := ImportMatrix("Matrix1.txt");
F := readstat("rows of the matrix");
C := readstat("columns of the matrix)")

LAG := C-1;
LAGG := F-1

for a to LAG do
for v to F do
for i to C-a do
h := m1(v, i);
r := m1(v, i+a);
..
..
.
.
in mathlab we use 

a=load('BROOKER.dat'); 

[m,n]=size(a);

but in maple? please help

Hello all.

Need help. 

My project are too slow calculate integrals. What can i do to speed up numerical integration?

Thanks all.
MP_1.mw

Here my worksheet that at the end of it I have a problem with the dsolve when solving an ode system. and the error is 

Error, (in StringTools:-IsPrefix) second argument must be a string

I know that the dsolve has problem with bracket . Then how can I fix it or how can I change my codes.

 optimal.mwoptimal.mw

How can i solve the problem? (Error, (in f) division by zero)

 

restart;
f := proc (z, n) local x, i, k, j;
for i to n
do
if i = n then x[i] := trunc(z/10^(n-1))
else x[i] := trunc((`mod`(z, 10^i))/10^(i-1))
end if
end do;
printf("The number %d has the digits:", z);
x[n+1] := 0;
for k from n by -1 to 1
do
print(x[k]);
x[n+1] := x[n+1]+x[k]
end do;
printf("The checksum is:");
print(x[n+1]);
for j to n
do
if `mod`(z, x[j]) = 0 then printf("The number is divisible by: %d\n", x[j])
else printf("The number is not divisible by: %d\n", x[j])
end if
end do;
for j to n
do
if `mod`(x[n+1], x[j]) = 0 then printf("The sum is divisible by: %d\n", x[j])
else printf("The sum is not divisible by: %d\n", x[j])
end if
end do
end proc;

f(12305, 4)

Error, (in f) division by zero

 

why can not draw graph in maple in this case and how to plot graph with matlab in maple

with(StringTools);
with(FileTools);
with(Matlab);
openlink();
evalM(sprintf("load fisheriris;X = meas(:,3:4);figure;plot(X(:,1),X(:,2),'k*','MarkerSize',5);"));
closelink();

Dear, I want to the expression for any r and s. Please help I am waiting your quick responce

Help.mw

With my best regards and sincerely.

Govt. Degree College Taxila

Dear, I am facing a problem which I run the attached file it this answer [Length of output exceeds limit of 1000000]. Please help to overcome this problem.

ytsf3.mw

With my best regards and sincerely.

Govt. Degree College Taxila

Hi, I solved some equations those days and get a group of data, namely, Data1. Then I want to get the function of the data, so I use the CurveFitting package of maple, and get the function easily (the function seems as a*x^3+b*x^2+c*x+d). But the function is not the one I really wanted, because it is hard to generate the complex curve (even the function is known) in some software. 

As I know, it is easily to generate some arcs in the software, so is there any way to fit a group of data with some piecewise of arcs?

 Best regards.

Data1:= [[.690499054221957, .109364306247567], [.679584570047867, 0.955093827253927e-1], [.668476295825779, 0.820785684569687e-1], [.657171143364362, 0.690714704619819e-1], [.645665768347822, 0.564884351571898e-1], [.633956566493958, 0.443305616055764e-1], [.622039668654294, 0.325997176601303e-1], [.609910934797136, 0.212985591645471e-1], [.597565946804089, 0.104305524003572e-1], [.585, 0], [.572208093323944, -0.998792942142104e-2], [.559184918035503, -0.195271676259796e-1], [.545924844835652, -0.286107087732754e-1], [.532421909264435, -0.372305667237386e-1], [.518669795218710, -0.453777271949494e-1], [.504661816411590, -0.530420942817277e-1], [.490390895570740, -0.602124307834357e-1], [.475849541144774, -0.668762917052363e-1], [.461029821255068, -0.730199502124052e-1]]

1. how to eliminate the diff(*(x,y,z),x) terms in an expression, "*" means any function which have independent variables x,y,z?

2. how to get the gradient of a vector, which should be a tensor?

Hi all,

 

I'm trying to create the 3D animation which can show the idea of rotating 2D function plot, such as:

 

with(plots):

display(seq(surfdata([seq([seq([x, cos(2*p*Pi*(1/25))*x^(1/2), -sin(2*p*Pi*(1/25))*x^(1/2)], x = 0 .. 4, .1)], p = 0 .. t)]), t = 1 .. 25), insequence = true);

But it's too inconvenient because of too many seq functions in this commond, is there any easier way to plot this animatiton?

Thank you.

I need to sort a list of vectors according to the alternating order defined as such: 

x <_alt y if x and y differ first in the ith place and

i is even and x_i > y_i or i is odd and x_i < y_i

(so that in even positions, the order is "flipped", and in odd positions, the order is the standard order).  

In this way, we arrive at 

0101 <_alt 0110 <_alt 0001 <_alt 1101 <_alt 1001

 

Below is an attempt...  

L:= [[ 0, 1, 0, 1], [0, 1, 1, 0], [0, 0, 0, 1], [1, 1, 0, 1], [1, 0, 0, 1]]

(in my actual code, my vectors will need to be of length 20).  

 Thank you for all of your help.  

Hello everyone,

I'm trying to solve system of ODE but it return this Error, (in fproc) unable to store 'YP[4]' when datatype=float[8]
How can this be corrected, see the worksheet YP.mw

Thanks.

Hi,

I am experiencing some problems with the plot3d command. It does not return a nice 3d-graph, but just a bunch of dashed lines. I have entered something like this:

with(plots):

plot3d(x*y,x=-1..1,y=-1..1);

I am using maple 17 on windows 7

Thanks in advance.

Int(ln(1+sqrt((x+1)/x)),x);

value(%);

 

Does not work.

 

Int(ln(2+sqrt((x+1)/x)),x);
value(%);

Works.

 

But with some effect,

 

 

Could this possibly be improved in the next release?

 

First 1271 1272 1273 1274 1275 1276 1277 Last Page 1273 of 2434