Error using contour (Z must be at least a 2x2 matrix. What changes should I make to my code to make Z a 2x2 matrix?
Show older comments
alpha=linspace(1,8);
beta=linspace(0,8);
a=(1/5).*(sqrt((2.*pi.*beta)./((alpha.^2)-1)));
u= sqrt((alpha.^2)+(beta.^2));
t= sqrt(1+(beta).^2);
G=real(a.*reallog((alpha+u)./(1+t)));
[X,Y] = meshgrid(alpha,beta);
contour(X,Y,G)
The final plot of the above code should resemble something like this:

I have double chekced, the formula is correct and the value of G at a given alpha and beta match with the experimental results. However, I face a problem with the dimensions of Z as it should be a 2x2 matrix.
Thank you in advance.
1 Comment
Cris LaPierre
on 30 Jan 2020
Minor correction - the error message says it should be at least 2x2.
Accepted Answer
More Answers (0)
Categories
Find more on Fractals in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!