Error is simple I think? "Matrix is singular to working precision" and my z(matrix) is full of NaN with the last collumn being full of "-Inf".
I am unsure how to correct this as I have introduced the formula for z mathematically correct with appropriate parenthesis.
Code is as follows:
xrange = -10:1:10;
yrange = -10:1:10;
xmat = repmat(xrange, length(yrange), 1);
ymat = repmat(yrange', 1, length(xrange));
z = (sin(sqrt(xmat.^2+ymat.^2)))/(0.1+sqrt(xmat.^2+ymat.^2));
mesh(xmat, ymat, z);
ANY HELP APPRECIATED THANKS :)
You are watching: Warning: matrix is singular to working precision.
This thread is archived
New comments cannot be posted and votes cannot be cast
Sort by: best
Your problematic line looks like it's using matrix division, but I'm guessing you want element division. In other words, try this:
z = (sin(sqrt(xmat.^2+ymat.^2)))./(0.1+sqrt(xmat.^2+ymat.^2));
FYI, I think your line would be throwing a warning (yellow text) not an error (red text).
Op · 1y
Omg i noticed that for the multiplication part but not for the division. That should solve it thank you greatly. Also for explaining the error vs warning. New matlab user :)
More posts from the matlab community
Continue browsing in r/matlab
Official MATLAB subcouchsurfingcook.com
Created Aug 15, 2009
Top posts april 16th 2020Top posts of april, 2020Top posts 2020
helpcouchsurfingcook.com coinscouchsurfingcook.com premiumcouchsurfingcook.com gifts
See more: Roy'S 2840 Dallas Parkway, Plano, Tx 75093, Roy'S Restaurant
Back to Top