Linked Questions

1 vote
1 answer
200 views

Passing f[x][[1]] to FindRoot [duplicate]

FindRoot seems to fail for most examples of the form f[x_?NumericQ] := {x - 3 , x^3}; FindRoot[f[x][[1]], {x, 3}] ...
Art Gower's user avatar
  • 586
13 votes
6 answers
918 views

An elegant way to plot a numeric function that returns a list, and have each element in a different color [duplicate]

I have a function that takes a numeric argument and returns a list of numbers. I want to plot each element of the list in a different color. If I use this command, ...
Joe's user avatar
  • 1,471
8 votes
4 answers
2k views

How to handle Part function error when position does not exist?

Say a list list={{1,2},{3,4}}, list[[1]] and list[[2]] works. But ...
liang's user avatar
  • 599
6 votes
3 answers
2k views

Numerically integrating a list-valued function [duplicate]

I want to NIntegrate a List valued function foo[x] which is only defined for numerical ...
user19095's user avatar
  • 389
9 votes
1 answer
2k views

NIntegrate receiving a function with NumericQ which returns a list

Can some one please explain why ...
Art Gower's user avatar
  • 586
3 votes
1 answer
9k views

Minimizing using indices, error: Part::pkspec1: The expression cannot be used as a part specification

I want to use Minimize where the variables to minimize are indices pointing into an array. Here a MWE that hopefully shows what my problem is. ...
NOhs's user avatar
  • 869
9 votes
3 answers
205 views

Indexed and array-valued interpolations

Bug introduced in 10.1 or earlier and fixed in 10.4.0 Using Indexed on an InterpolatingFunction leads to an ...
Michael E2's user avatar
  • 238k
5 votes
2 answers
1k views

FindFit “is not a real number” error when fitting a parametric function to the data

I am using Mathematica's FindFit function to fit a parametric solution to my data and I am getting the error ...
Sam's user avatar
  • 53
5 votes
2 answers
536 views

Integrating a list of functions

For the purpose of this minimal example, let's say we have a list of functions, like this: f[y_?NumericQ] := {NIntegrate[z*y, {z, 0, 1}], a y} I want to ...
Emerson's user avatar
  • 1,217
7 votes
1 answer
262 views

Why don't optimization functions like FindMinimum work with functions like BSplineFunction? [duplicate]

Take a simple BSplineFunction and evaluate it at 0.25. ...
C. Kyle's user avatar
  • 73
3 votes
1 answer
103 views

RecurrenceTable involving inputs from a vector

Directly going to the issue, my problem is how to use a RecurrenceTable when it have inputs from a vector defined previously. For instance I have: ...
Reza Faraji's user avatar
2 votes
1 answer
134 views

function on parts of lists works only in pure function?

For example, I'd like to take the first four upper left values of a matrix, i.e. f[x_] := f[x] = x[[;; 2, ;; 2]]; This works nicely, e.g. ...
riddleculous's user avatar
0 votes
1 answer
263 views

Order of evaluation in nested expression

I am trying to make a function that works as follows: Integrate 1 for all t in the interval $ [0,1] $ such that the first element of function vstar is positive. <...
Emilio Calvano's user avatar
0 votes
2 answers
44 views

Getting Part::partd and Part::partw messages in the following example

...
Benjamin Bental's user avatar