Error in creating a volcano plot in MATLAB I am a complete newbie to MATLAB and the first task I have is to create a volcano plot. I have been using this link to understand about it and get started.

I tried to run it on dummy values - 

a=[1 2 3]

b=[4.6 2.7 4.5]

c=[0.05 0.33 0.45]


And then I ran - 

SigStructure = mavolcanoplot(a, b, c)


My understanding is that a represents the gene expression values for condition 1, b for condition 2, and c is the list of p-values for the 3 data points in a and b.

However running this code gives me the error - 

Index exceeds matrix dimensions.

Error in mavolcanoplot (line 127)
appdata.effect = X(paramStruct.goodVals) - Y(paramStruct.goodVals);

Error in volc (line 4)
SigStructure = mavolcanoplot(a, b, c)


Can anyone explain where I am going wrong?
I'm not sure if nowadays matlab is still a good option for informatics. I would rather go for a R script to make a volcano plot. If you don't want to have fancy code but functional one, you can even make the foldchange calculations and log2 transformation in excel and just plot the log2 fold change in x axis and the -log10 transform of the p/q values on the y axis.
If you need it, I could provide one of my own scripts.



Update: here is the actual script:

#load data into the 'res' variable
res &lt;- read.table("genes.txt", header=TRUE)
head(res)

# Make a basic volcano plot with grey dots
with(res, plot(log2FoldChange, -log10(qvalue), pch=19, col="#4A4E4D", xlab="Log2 Fold Change", xlim=c(-8,8)))

# Add colored points: "indianred" if padj&lt;0.0001, orange of log2FC&gt;2, green if both)
with(subset(res, qvalue&lt;.0001 ), points(log2FoldChange, -log10(qvalue), pch=19, col="#17B090"))
with(subset(res, abs(log2FoldChange)&gt;2), points(log2FoldChange, -log10(qvalue), pch=19, col="#F89538"))
with(subset(res, qvalue&lt;.0001 &amp; abs(log2FoldChange)&gt;2), points(log2FoldChange, -log10(qvalue), pch=19, col="#FA6367"))