# Questions tagged [conditional]

Questions about programming or mathematical constructs that enable verification, selection, or branching behavior when one or more criteria are determined to be True.

414 questions
Filter by
Sorted by
Tagged with
1answer
38 views

### Manipulate, IF statements, and displaying plots

When using manipulate and plotting a function within an IF statement, curly brackets appear in the panle with the displayed plot. Here is a simple version of the issue. Can someone tell how to ...
1answer
95 views

### How can I add conditions to simplify the result?

Here k is an integer number. How can I simplify the result by adding conditions like k is odd or even? Also why are the 0^k terms not simplified to 0? ...
1answer
42 views

### How to use condition that adjacent elements are not acceptable for iterations

I'm trying to figure out how to create a matrix in mathematica, since I'm just starting working with the program to get a feel before I start graduate school. I'm working through a book problem where ...
1answer
39 views

### Plot part of a contour curve of the imaginary part of a complex function

I want to plot some contour cuvres of a simple function $f(z)=((z + 1/z)^2 - 4)*(1 - I)$. The code ComplexContourPlot[Im[((z + 1/z)^2 - 4)*(1 - I)] == 0, {z, 2}] ...
2answers
49 views

### Replacements: using condition to restrict to parts that satisfy a Boolean expression

I need to replace all integers k in a list with {k} and tried: EDITED: as a clarification: I mean all integer elements of a list, not all integers in the list, so in the following example, only 4 ...
1answer
52 views

### Manipulating lists based on conditionals and 3D plotting the smooth surface that bounds a list of points

First of all I want to create a list of evenly spaceed points in a cubic region in $\mathbb{R}^3$. Then I want to keep the points in this list which satisfy a certain condition, i.e. a function that ...
1answer
24 views

### Conditional tab view

I'd like to create a tabview with conditions on it, rather than put the tabview inside an If statement, to reduce the length of my code. i.e. ...
2answers
47 views

### Using If to Plot functions with specified parameters [closed]

Here's the question: Plot f1(x) between x = -10 and x = +10, where f1(x) = +x2 when x is positive, f1(x) = -50 when x is -2 or smaller, and f1(x) = 0 otherwise I'm new to using Mathematica and the If ...
2answers
118 views

### How do I use If to plot a function conditionally

I am trying to use the If so that when the 1st argument is true, it plots a graph of a function and when false, returns 0. I know that the format of an if statement ...
0answers
61 views

### If condition in differential equation

I need to plot the Integrate the Fire model of neuron. The differential equation is $\frac{dV}{dt} + \frac{V}{\tau} = \frac{I}{C}$. The initial condition is $V(0) = 0$. And there is this condition if ...
0answers
23 views

0answers
40 views

### How to generate conditionals programmatically? [closed]

I need to generate conditionals (||, &&, etc) from a list conditionList that I don't know beforehand how many/which elements will it contain. For simplicity,...
0answers
73 views

### Using an if statement to assign a value to a variable

New Mathematica user here. I'm using some code from a colleague and editing it to give me more specific results in finding the zeros of a complex polynomial. I am attempting to find a way to assign a ...
0answers
46 views

...
1answer
48 views

### Cannot get conditional Take[…] from List[…] to work inside a user-defined function

Abstract I have a function eqsfromMatrix[...] that does exactly as it sounds. It returns a list of equations given matrix m for ...
4answers
222 views

### Dropping some row from a Table with If condition [closed]

I have to drop the rows of a table only when the element in the first coloumn of the row satisfies multiple condition. The table: ...