Skip to main content

Questions tagged [mapthread]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
6 votes
1 answer

Adding shadows to spiric sections of a torus

While adding shadows to the spiric sections of a torus using the The answer to the question given by Daniel Huber, I faced a problem. Instead of being well separated as previously, the sections ...
user444's user avatar
  • 2,644
1 vote
1 answer

Define certain argument in functions which depend on several arguments and built in a list

I got confused working with list of functions of two variables. I construct few lists of functions, one is vector of functions List1 and another is 2D list of ...
seva011's user avatar
  • 336
1 vote
1 answer

Combining legends from parameterized plots and positioning these to not exceed frame width

I have combined five different plots based on a parameter each with its own legend. Now, I want to position legends below the combined plot. The following is one of the sample codes: ...
Isha Arora's user avatar
1 vote
0 answers

Cross product of a vector and a matrix

I defined a symbolic matrix with vector elements as: ...
Harken's user avatar
  • 105
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,444
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
1 vote
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
  • 446
4 votes
2 answers

How to do AssociationThread recursively?

Consider the following sequence of deepening lists: ...
user13892's user avatar
  • 9,523
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
  • 575
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
10 votes
5 answers

Threading arguments from lists of different size

How to construct the function combinationsF ? ...
Albercoc's user avatar
  • 998
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
5 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,059
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,966
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
  • 379
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
2 votes
4 answers

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

I have a function whose 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 those the ...
Alex97's user avatar
  • 420
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
5 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
  • 73
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,164
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
1 vote
2 answers

Calculating area for triangular geometries

Is there a function suitable for calculating areas for geometries involving triangles? I have used the formula for the area of the triangle. ...
user avatar
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,599