Anthrazit

865 Reputation

11 Badges

5 years, 154 days

MaplePrimes Activity


These are questions asked by Anthrazit

Strange thing happening when changing the view zoom factor, as images are not scaling.

That makes it very difficult to generate print documents, a case we've talked about previously.

The first image is a screenshot with 100% scale factor, the other one with scale factor 400%.

One could argue, that I could switch to Print Layout Mode. But the problem there is that I don't have any view zoom factor at all.

I am trying to find the minimum values of a table, but not of all of its indices, just some that comply to a certain pattern.

The minimum of the values of a table are found by using min(entries(atable)).

If the indices of atable are "a1", "a2", "b1", "b2", I would like to just have the ones starting with "a".

Can be done by a loop, but is there a easier way?

Just wonder if someone has any hints about correct code debugging.

Especially I'd like to know how often certain subroutines are called, and where from.

Any idea why parse("a", 'statement') doesn't return the value of the variable, but only its name?

Running the same command directly works.

Download ParseStatement.mw

I've got a problem where I need to find the shortest route between a list of points. Each point must only be visited once.

To solve the problem I admit that I have used ChatGPT. While the answer was very helpful, the thing is that it apparently doesn't work (yet). The problem is that the function in the package is not existing.

Here's the ChatGPT code.

Any help appreciated.

euclidean_distance := proc (p1, p2) options operator, arrow; sqrt((p1[1]-p2[1])^2+(p1[2]-p2[2])^2) end proc; points := [[0, 0], [1, 2], [3, 1], [5, 4]]; distance_matrix := Matrix([`$`([`$`(euclidean_distance(points[i], points[j]), i = 1 .. 4)], j = 1 .. 4)]); solution := Optimization:-LinearSumAssignment(distance_matrix); optimal_route := [`$`(points[i], `in`(i, solution[1]))]; total_distance := add(`$`(distance_matrix[i, solution[1][i]], `in`(i, solution[1]))); print("Optimal route:", optimal_route); print("Total distance:", total_distance)

"Total distance:", total_distance

(1)

NULL

Download TravellingSalesManChatGPT.mw

1 2 3 4 5 6 7 Last Page 2 of 25