Very new to Mathematica, so pardon my ignorance.
I am trying to plot x
vs y1
and x
vs y2
on the same ListPlot
.
Here is what the data look like:
x = {1,2,3,4}
y1 = {3,4,5,6]
y2
results from FindIteration and gives me a result like this:
y2 = {{5},{6},{8},{9}}
How can I convert y2
such so it has the same shape as x
and y1
?
My iteration code is
Do[y2new =
ynew /. FindInstance[
function1[x[[i]], ynew] == function2[x[[i]], ynew], ynew, Reals];
y2[[i]] = ynew, {i, Length[x]}]
Is there a way to change the assignment of y2
values so the resulting array y2
has the same shape as x
and y1
?
y2[[{i}]] = ynew
$\endgroup$