jan

79 Reputation

5 Badges

20 years, 55 days

MaplePrimes Activity


These are replies submitted by jan

I don't mind being displaced from the front page. If I really wanted to get back to the front page, I would write a couple of books (at 5 points each) and that would be enough to get me back to the front. This really raises an interesting point about the ranking. Why is a book worth 5 times more than a regular post. I could search wikipedia for some random place that is related to math and write it up as a book. Is this worth 5 times more than answering someone's question? A better approach, that would actually reflect the value added, would be to weight each submission by the number of times it has been read. So the total points that a user had would be calculated as a sum of all the views of their post. Jan
This could be a case of some file extension sites being maintained better than others. For example the site filext.com knows about Maple MW and MWS extensions. MW MWS Jan
Yap is also available on Windows. You can get it in the MikTex distribution available at www.miktex.org. Jan Applications Engineer, Maplesoft
Hello Alec, Here are some improvements to the ImageTools packages: - Thre rotations will be limited in steps of 90 degrees. - The viewer will launch external Maplet viewer, that can display one or more images. - cropping and combining images together - some intensity manipulations - support for colour images using RGB, YUV, and HSV colour spaces - image thresholding The next release of Maple is currently in beta right now, so you should be able to try some of these out. Jan Applications Engineer, Maplesoft
you will be able to do this: with(ImageTools): A:=Read("humor.jpg"); B:=Rotate(a, 90); View(B); Jan Applications Engineer, Maplesoft
Hi Alec, I agree that the Preview is not the best solution to view images. It is pretty heavy on the memory, and all the images get rescaled to 320 by 200. Maple really does not have a way to programatically insert images into the worksheet. Here are a couple of solutions that you may want to look at, both of which have limitations. One way to insert images into the worksheet is to read them in with the ImageTools:-Read. The images are stored as arrays, so we can double click on the image to browse it. Then under the Image tab, you can click on the Insert button to paste the images into the worksheet. The limitation here is that only grayscale images are pasted to the worksheet. Another solution is to use Maplets to display the image. This is pretty light weight and fast. The drawback here is the fact that images are not embedded (and therefore saved) in the worksheet and separate viewer must be launched to view them. You could work around that by spliting the code into image generation part that you would run once and create the images. The second part would then be used to view the images, which you would rung many times. BM:=proc(n::posint,m::posint) local X,N,W,A,c,i,fname, maplet; uses Statistics,ArrayTools,ImageTools, Maplets[Elements]; X:=RandomVariable(Normal(0,1/sqrt(n))); N:=Concatenate(2,Array(1..m),Alias(Sample(X,m*n),[1..m,1..n])); W:='CumulativeSum(N[i])'$i=1..m; A:=`+`(W)/m; c:=[seq(evalhf(i/n),i=0..n)]; fname := cat(currentdir(),"/",cat("BM",args,".jpg")); plotsetup(jpeg,plotoutput=fname); print(plots[display]( LineChart(A,xcoords=c,color=red,thickness=2),LineChart([W],xcoords=c), symbolsize=1,axes=boxed)); plotsetup(default); maplet := Maplet(Window('layout'='BL1'), BoxLayout['BL1']( BoxCell( Label(Image(fname)), 'hscroll'='as_needed', 'vscroll'='as_needed'), BoxCell( Button("Close", Shutdown()) ) ) ): Maplets[Display](maplet); end: Jan Applications Engineer, Maplesoft
Maple 10 contains ImageTools package that can import images from JPEG, BMP, or TIFF formats, and perform some rudimentary image processing operations. ?ImageTools,Read should give you more information. Jan Applications Engineer, Maplesoft
Here is an example to get you started: val := [seq(x_, x_=-1..1,0.2)]; lbl := map (x_ -> sprintf("%3.2f", -x_), val); tck := zip((x_,y_) -> x_=y_, val, lbl); plot(sin(x), x=0..10, tickmarks=[default, tck]); Jan Applications Engineer, Maplesoft
Here is an example to get you started: val := [seq(x_, x_=-1..1,0.2)]; lbl := map (x_ -> sprintf("%3.2f", -x_), val); tck := zip((x_,y_) -> x_=y_, val, lbl); plot(sin(x), x=0..10, tickmarks=[default, tck]); Jan Applications Engineer, Maplesoft
This can also be done with a built in command seq: [seq(i, i=0.0 .. 0.5, 0.02)]; [0., 0.02, 0.04, 0.06, 0.08, 0.10, 0.12, 0.14, 0.16, 0.18, 0.20, 0.22, 0.24, 0.26, 0.28, 0.30, 0.32, 0.34, 0.36, 0.38, 0.40, 0.42, 0.44, 0.46, 0.48, 0.50] To create a vector, we then would do the following: v := Vector([seq(i, i=0.0 .. 0.5, 0.02)]); Jan Applications Engineer, Maplesoft
This can also be done with a built in command seq: [seq(i, i=0.0 .. 0.5, 0.02)]; [0., 0.02, 0.04, 0.06, 0.08, 0.10, 0.12, 0.14, 0.16, 0.18, 0.20, 0.22, 0.24, 0.26, 0.28, 0.30, 0.32, 0.34, 0.36, 0.38, 0.40, 0.42, 0.44, 0.46, 0.48, 0.50] To create a vector, we then would do the following: v := Vector([seq(i, i=0.0 .. 0.5, 0.02)]); Jan Applications Engineer, Maplesoft
I don't think that you can make sections of the code execute programatically (by pressing a button or or any other way). However, one way that may work, is to collect up the sections of code that you want to execute and make them into a procedure. Then you can place the procedure call inside the button, so that every time you press the button, the procedure is executed. The only caveat here is the fact that you do not get the output from the procedure. To see the output, you would have to create one or more embedded components int the worksheet, such as text field, plot, or math container. The you have to add to the procedures code that would write the results to these components. Hope this helps, Jan Applications Engineer, Maplesoft
You can try the following: My := Matrix(512,512): My[1..256,1..256] := M1: My[1..256,257..512] := M2: My[257..512,1..256] := M3: My[257..512,257..512] := M4: This creates the target matrix and then just copies the entries over without evaluation. Here is a complete test case: Create test matrices: M1 := LinearAlgebra:-RandomMatrix(256,256); M2 := LinearAlgebra:-RandomMatrix(256,256); M3 := LinearAlgebra:-RandomMatrix(256,256); M4 := LinearAlgebra:-RandomMatrix(256,256); This takes about 40 seconds on my computer: st:=time(): Mx := <<M1|M2>,<M3|M4>>; time()-st; This takes less than a second on my computer: st := time(): My := Matrix(512,512): My[1..256,1..256] := M1: My[1..256,257..512] := M2: My[257..512,1..256] := M3: My[257..512,257..512] := M4: time()-st; Check that both techniques produce the same matrix: LinearAlgebra:-Norm(Mx-My); Jan Bakus Applications Engineer, Maplesoft
Instead of this: GetProperty(Rsh,value); Rsh:=%; You probably want to do something like this: Rsh := parse(GetProperty('Rsh','value')); You need to call parse, because the GetProperty returns a string, and you want to convert the string to a number. Another thing that you may want to do is rename the text box to say Rsh_text and then the command would become: Rsh := parse(GetProperty('Rsh_text','value')); Jan Applications Engineer, Maplesoft
You can use the title option to set the title for each of the frames. Since the title can be specified as a string, you can use sprintf to form the string. Here is an example. tmp := NULL: for i from 1 to 100 do tmp := tmp,plot(sin(i/10.*t), t=0..10, title = sprintf("Frame %d", i)); end do: plots[display](tmp, insequence=true); Jan Applications Engineer, Maplesoft
1 2 Page 1 of 2