MATLAB: Contour Plotting matrix size issue

contourplotting

I am trying to plot computations using the contour plot, but am not sure how to because my z variable is the computation results and the dimensions are larger than y and x.
b = [0.1, 1.0, 10, 100];
R = (1:0.2:5);
theta = 45;
[F] = ratio_rp_bf(b,R,theta); 5x21
x = R.*cos(theta); 1x21
y = R.*sin(theta);1x21
z = [F];
Am I trying to plot the wrong things?

Best Answer

When you use
contour(XVALUES, YVALUES, ZVALUES)
then XVALUES should be a vector of length size(ZVALUES,1), and YVALUES should be a vector of length size(YVALUES,2). Your Z is 5 x 21, and your R is of length 21 (so your y is too), but you do not appear to have any variable of length 5 to supply for XVALUES.
Are you sure you want to contour? And not that you want to plot 5 lines in 3 space?