Error is an easy I think? "Matrix is singular to functioning precision" and also my z(matrix) is complete of NaN with the critical collumn being complete of "-Inf".

I am unsure exactly how to correct this as I have actually introduced the formula for z mathematically exactly with appropriate parenthesis.

Code is together follows:

clf;

clear all;

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 many thanks :)




You are watching: Matrix is singular to working precision matlab

2 comments
share
save
hide
report
100% Upvoted
Log in or sign up to leave a comment
Log InSign Up
Sort by: best


*

level 1
· 2y
uses_spinmap
Your problematic heat looks like it's utilizing matrix division, however I'm guessing girlfriend want facet division. In other words, shot this:

z = (sin(sqrt(xmat.^2+ymat.^2)))./(0.1+sqrt(xmat.^2+ymat.^2));

FYI, i think her line would certainly be throwing a warning (yellow text) no an error (red text).


1
Reply
Share
ReportSave
level 2
Op · 2y

Omg i noticed the for the multiplication component but no for the division. That must solve it say thanks to you greatly. Likewise for explaining the error vs warning. Brand-new matlab user :)


1
Reply
Share
ReportSave
*

r/matlab
Official MATLAB subdiscoverhotmail.com
42.9k

coders


44

logged in


Created Aug 15, 2009
Join
*
*
*
*

*

Top articles april 16th 2020Top short articles of april, 2020Top write-ups 2020
helpdiscoverhotmail.com coinsdiscoverhotmail.com premiumdiscoverhotmail.com gifts
aboutcareerspressadvertiseblogTermsContent policyPrivacy policyMod policy


See more: Look Earth Executive Vip Tall Directors Chair W/ Folding Side Table

Back to Top