1
votes

I have two arrays:

sigma = logspace(-4,4,5)

which looks like = [10^-4,10^-2,10,10^2,10^4]

and some other array that contains 5 values which were generated from norm-2 of some 5 different vectors. assume this is the second array:

Xnorm = [1,2,3,4,5]

I'm trying to plot those two arrays:

figure()
plot(Xnorm,sigma)

I would like that sigma will represent the X-axis and Xnorm the y-axis. The result right now is an empty graph. (I've tried to swap between both of them also).

Unfortunately, I did not found any good documentation for plotting with array.

1

1 Answers

6
votes

You need to import the plotting library

sigma = logspace(-4,4,5)
Xnorm = [1,2,3,4,5]
# Pkg.add("Plots") # Do this only the first time to install.
using Plots
plot(Xnorm,sigma)