Mathematica study punch day 4

Mathematica study punch day 4

---- Taiyuan University of Technology Robotics Team

Today's content to edit the list, which is to undertake the last of content (learning content from the beep beep miles miles)

Delete elements - Drop Function and Delete function

Drop function and Delete functions are possible operand table, responsible for the bulk deletion of elements in the number of tables, handling Drop function is used to delete a continuous element, and Delete functions allow individual elements. .。

Which refers to the negative elements were removed from the list of reciprocal forward, a positive number means that the former elements deleted backwards. Similarly 0 refers not deleted.

Delete function it would be more special to delete individual elements, but if you want to delete selected several elements, still need to use Delete. .。

Common Problems

As the novice operation will inevitably be mistakes, I'll list two common problems

Elements of the list must be bracketed braces, Mathematica functions commonly used brackets are brackets, and if in square brackets, how rigorous statement even before and after the use of elements of the program will not run, and this error is not an error of but in the end face with a red square brackets suggesting there are errors. .。

A list of names of such s, the letter can not be used as an element in the list again, otherwise, will be an error. .。

Append function and insert elements AppendTo-

As with files in general, have to delete the original elements have inserted new elements, there is a slight difference in the Append function and AppendTo function. . 。The figure can be seen running output case inserted between the two is exactly the same, but the content of the final output of the table may have changed, and why? This is due to run most of Mathematic function is not given to the actual value of the original number of tables, and the function was able to be given to the original value after the operation table, which led to a different final result.

Sort the elements - Sort function

This function can be performed automatically according to the size of the input elements to sort, the input sentence seventy-eight compared to the C language, to be more concise. To carry output plus a descending manner Greater later. Also note that the function of special brackets are Sort [{}] form, the same symbol error is not allowed. .。

Apply Function - A list of summation

Apply function of the form generally Apply [Plus, the list] (represents the sum), Apply [Times, the list] continuous rideproduct

Split and merge lists

d = Flatten [c] c is the gauge pressure into a two

The Partition [d, n] is divided into the elements of d, each of the n-gram list. .。

Released four original articles · won praise 1 · views 58

Guess you like

Origin blog.csdn.net/arcsin2x/article/details/104637631