smith_alpha

155 Reputation

6 Badges

12 years, 149 days

MaplePrimes Activity


These are replies submitted by smith_alpha

@Kitonum Thank you!

 

@Kitonum Thanks a lot. I mean, how do you get "[2,1,1,1,2]"? By experiment?

 

@Kitonum Thank you very much! It works now. Excuse me, would you please explain to me, that why  

a:=op([2,1,1,1,2], [%]);

 would be able to substract that location of maximum value? Thank you!

@Markiyan Hirnyk 

 

For instance, if one assumes there is a gaussian distribution for points, e^(-a(x-x0)^2), one would like to generate points satisfy this distribution. In my case, the function is a user-defined function.

 

@tomleslie Thank you very much!

 

@tomleslie 

  Thank you so much! I would like to save "1" "2" and "****" in the array. What kind of modification will be needed?

 

Thanks 

 

@Carl Love  Thank you! It works now!

 

@Carl Love Thanks a lot!

fscanf + readdata works

However, if I use 

h:=ImportMatrix(filename,skiplines=1);
print(h);

 

it just gives me

[2

1]

without 0.0...1.6 etc.. How to use ImportMatrix correctly? Thank you

 

@Carl Love 

That's a good idea. But it seems readline will obtain string format by default, and i did not find a way to convert it into integers. 

 

Is there any way to let maple read the first line in terms of integer type?

 

Thank you

@Carl Love Thank you! It works now.

@Preben Alsholm  I see. I forget there is no txt in the code! It works now!

@Preben Alsholm 

 

Thanks. The same data is indented, since it is a test case.

 

But, I tried 

 

for i from 1 to 3 do
  file_name:=test||i; 
  writedata[APPEND](cat("D:/",file_name),A);
end do;

 

since I do not have G section. But I didn't find those files in d:\....

 

 

@Carl Love Thank you very much for your explanations.

@Carl Love  Thank you very much! It works at least for n=2 case. Excuse me, I still don't understand

 

1) What is the role of "$"?

2) What does "||(1..n)" mean? 

3) Would you recommand some refence that I can learn more "gramma" in maple like the example you have constructed?

 

Thank you very much!

@Kitonum Thank you very much!

1 2 3 4 5 Page 2 of 5