Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 2000

Questions on the manipulation of List objects in Mathematica, and the functions used for these manipulations.

4 votes
2 answers
239 views

Simpler way to repeat an execution with 2D points?

q has the coordinates of quadrilateral. I can get the output below with brute-force but I want to find a simpler solution, perhaps something like f<-q[[1;;2]]. Initializations f[x_, y_] = {{1, 2}, { …
hhh's user avatar
  • 2,633
-2 votes
1 answer
116 views

Suppressing Null output with sparse data? A lot of zeros and little nonzeros

I have sparse situation with a lot of zeros, related chat. I want to see only the nonzero things or nonnull things. Example Input hello[ii_, jj_] := If[ii == 1, Return[True], Return[False]] Tabl …
hhh's user avatar
  • 2,633
4 votes
2 answers
933 views

Deleting vertices from a Graph and preserving structure

My goal is to remove vertices from graphs (and the edges from them) and then take GraphComplement to find out cut sets in graphs with sink and source such as here. So How can I delete vertices from a …
hhh's user avatar
  • 2,633
2 votes
Accepted

Deleting vertices from a Graph and preserving structure

The solution for the GridGraph here. You need to fix the VertexCoordinates before deletions. G = SetProperty[G, VertexCoordinates -> GraphEmbedding[G]]; VertexDelete[G, deleteMe]
hhh's user avatar
  • 2,633
2 votes
3 answers
1k views

Matlab-style Find in Mathematica? Value list and Boolean List, how to select values accordin...

I want to select elements with the true value (Indices list) in the corresponding point to the value list (MCS). Is there anything like Matlab-style Find to get the indices of true values in the boole …
hhh's user avatar
  • 2,633
5 votes
Accepted

Matlab-style Find in Mathematica? Value list and Boolean List, how to select values accordin...

As Rojo suggested, Pick works -- yet there may be other solutions.
hhh's user avatar
  • 2,633