Help: Regarding plotting multiple tracers in a single graph with different ranges (mathcad 15)
Dear all,
I need to plot multiple functions in a singe graph but ideally would like to plot each of them in their own range. For example,
x = 1 to 10, y(x) = sin(x)
x = 5 to 15 g(x) = cos(x)
x = 50 to 65 k(x) = (sin(x))^2
But if I try to plot all 3 graphs in a plot (x ranging from 1 to 100), I get 3 long curves (basically all 3 plots from 1 to 100). Is there any way I can curtail them ? I can do it using
plot_(x) := | plot(x) if x > 1 (ctrl+&) x < 10
| NaN otherwise
But is there a faster / smarter way to do this ?
Also, does mathcad have a plot function command (for ex; like matlab) ? I also have a variable for the number of graphs I need to show in a plot (for example, it need not be 3 like shown above, but 4 or 5 or 2 depending on user input). Currently I am planning to put 20 (safe estimate) graphs and setting the values to "NaN" if the value does not exist (not input by user).
For example, if the user inputs 5 graphs (i = 5)
plot1_(x) := | plot1(x) if x > 1 (ctrl+&) x < 10 (ctrl+&) 1 < i
| NaN otherwise
Doing this manually 20 times will automatically plot only the first 5 graphs, but it looks very amateurish and is there a smarter way to do it (less code) ?
Please advice 🙂
Many thanks in advance,
Aravind.
