Questions tagged [mapthread]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4 votes
4 answers

Using MapThread with pure function and variable number of elements

I have a variable size array of lists and would like to set up a MapThread of the lists with a variable pure function $\{\#1,\#2,...,\#n\}\&$ with $n$ being the number of rows in the array and am ...
josh's user avatar
  • 2,332
2 votes
2 answers

Convert list of variables to list of parametrized functions

I have a list of differential equations of some variables eqns = {f[x,y,x',y'],g[x,y,x',y']} e.g., f[x,y,x',y'] = x x' + y y'. ...
Joalito's user avatar
  • 123
0 votes
2 answers

Export multiple results to sequentially named Excel sheets

When, I want to export a lot of my results to excel, how can I make sure that the Sheet name is also listed according to the results? For example, There is a following the result. ...
hare's user avatar
  • 406
4 votes
2 answers

How to do AssociationThread recursively?

Consider the following sequence of deepening lists: ...
user13892's user avatar
  • 9,303
2 votes
4 answers

Generating a Table with two fixed variable and varying the third variable

I want to generate a table in which two of the variables (x,y) are fixed with 1<->1 correspondence while the third variable is varying in the given range for each each sublist. I want to program ...
SciJewel's user avatar
  • 369
1 vote
2 answers

How to change the plot legends while mapping a plot command

I want to change the plot legend in each panel while mapping a plot command. e.g., in the example below ...
Mahdi Razaz's user avatar
0 votes
1 answer

Solving Transcendental Equations [closed]

I want to solve the transcendental equations as follows $$ A=\frac{w^{\frac{b}{a}}}{c^{\frac{2}{a}}}\mid cos(\frac{b\pi}{2a})\mid $$ $$ c=\frac{c^{\frac{2}{a}}}{w^{\frac{b}{a}-1}}\mid csc(\frac{b\pi}{...
Shiwen Feng's user avatar
1 vote
1 answer

Why does my Thread from Alphabet to morseAlphabet not work?

I have Thread[Alphabet[] -> morseAlphabet[]] But I don't get morse code for each letter, instead: ...
marie_antoinette's user avatar
9 votes
4 answers

Threading arguments from lists of different size

How to construct the function combinationsF ? ...
Albercoc's user avatar
  • 976
7 votes
2 answers

Plotting set of functions with individual regionfunctions using PlotLegends

In this simple example, a set of functions is plotted using PlotLegends functionality. ...
Ulrich Neumann's user avatar
8 votes
4 answers

How to Thread lists elementwise with the If function?

Consider the lists: list1={a,b,c}; list2={x,y,z}; I want to Thread If elementwise across ...
podge cassidy's user avatar
0 votes
0 answers

How to mimic Expand with Thread?

I want to mimic Expand[(a + b) (c + d)] with Thread. My attempt below does not provide the correct result: ...
Display Name's user avatar
  • 2,009
3 votes
3 answers

How to get the all the lists of preimages of a surjective map is the image is given?

Firstly, I want to construct a map with the preimage {{5}, {4, 3}, {4, 2}, {3, 2, 1}, {2, 2, 1}, {2, 1}} and the image ...
babyblue's user avatar
4 votes
3 answers

Thread Matrices, like image channels

The code With[{matA=Partition[Alphabet[],5],matB=Partition[Range@25,5]}, (* matA and matB are 5x5 matrices*) MapThread[List,{matA,matB},2] ] is fairly ...
Adam's user avatar
  • 3,937
3 votes
1 answer

Apply If statement to strings within list of lists

I think this a fairly basic question but I'm a relative newcomer to coding and would appreciate any help. I have a list of lists. Within the lists there are a mixture of strings and numbers. I want to ...
wmv's user avatar
  • 359
6 votes
4 answers

Sum over two independent variables [closed]

I have a function f[x,y] and try to generate a sum of it where x and y vary predictably but ...
Nick Lee's user avatar
  • 163
1 vote
1 answer

How to separately pass elements of a 3D list as part of the arguments of a function

Hi I have a function which its arguments have the form F[a,b,c,d,e] but the 2nd to 4th arguments are in a list of the form R={{{b,c,d},{e,f,g}},{{h,i,j},{k,l,m}}} how can I pass these elements as ...
Alex97's user avatar
  • 390
1 vote
1 answer

nested MapThread

I am trying to repair a list of supposedly monotonically and smoothly ascending numbers, like a CDF. An example would be like ...
Z Ming Ma's user avatar
  • 497
4 votes
3 answers

Thread map to 2 lists of inputs, including the nondiagonal terms

Given a function f and two lists of variables {a1,a2,...}, {b1,b2,...} How can I generate a following list ...
Rui Yu's user avatar
  • 63
0 votes
0 answers

Evaluate a function with 3 different variables for the whole list of each variable

I have a function with 3 variables f[t1,t2,t3] Each function has a list of values ...
user81524's user avatar
2 votes
1 answer

Example of when explicitly using MapThread is better than giving a function the Listable Attribute

This answer says that Listable just makes the function automatically apply MapThread to its arguments. Does anyone have a simple ...
user106860's user avatar
15 votes
1 answer

Metropolis-Hastings Algorithm - Significantly slower than Python

I would like to code a Metropolis Hasting algorithm and thought I would get the general scheme of things going with a toy example. I think I got it running but my Mathematica code runs significantly ...
Smerdjakov's user avatar
1 vote
2 answers

Is there a workaround to dereference a list element that's the name of an undefined symbol, and iteratively assign values to the symbols in the list?

The title mostly covers what I would like to do. The image below shows in some situations it is possible dereference an element in a list using Evaluate to assign a value: ...
Dustin Darcy's user avatar
6 votes
3 answers

Nested lamdas: MapThreading a MapAt lambda

Consider a set of (here) 3 series ...
lineage's user avatar
  • 1,144
2 votes
4 answers

MapThread over a list of sublists

I am trying to plot a list of two sublists, each of length 5 to produce two curves: aaa = {{0, 1, 2, 3, 4}, {5, 6, 7, 8, 9}}; imax = 5; I tried two ways to no ...
Z Ming Ma's user avatar
  • 497
22 votes
3 answers

Generate a Unit Circle Trigonometry

Struggling often with Trigonometry I would like to have some code to generate this Unit Circle Trigonometry. Would be of great help when I need to transform some data :
500's user avatar
  • 5,529