matrix is singular to working precision , Contour not rendered for non-finite ZData

조회 수: 1(최근 30일)
Hello,
I have read through all the trouble shooting advice on this website for the above error. I have attached my code, and I am not sure what I am doing that is causing this error.
Could somebody guide me what I am doing wornk?
Thanks.
function [] = Plot3D(cellArray,charArray)
x = linspace(-15,15,100);
y = linspace(-15,15,100);
[xx,yy] = meshgrid(x,y);
z = (sin(sqrt(xx .^2 + yy .^2)))/(sqrt(xx .^2 +yy .^2));
switch charArray
case 'surfc'
surfc(xx,yy,z);
xlabel(cellArray{2});
ylabel(cellArray{4});
zlabel(cellArray{6});
case 'surf'
surf(xx,yy,z);
grid on;
title("This is the surf:");
case 'contour'
grid on;
contour(xx,yy,z,'ShowText','on');
axis([-15 15 -15 15 -15 15]);
otherwise
subplot(2,2,1);
surfc(xx,yy,z);
subplot(2,2,2);
surf(xx,yy,z);
subplot(2,2,[3,4]);
contour(xx,yy,z);
end
  댓글 수: 3
idan
idan 2022년 7월 21일
Hello,
This is the error:
Warning: Matrix is singular to working precision.
Warning: Contour not rendered for non-finite ZData
Warning: Matrix is singular to working precision.
Warning: Matrix is singular to working precision.
Warning: Contour not rendered for non-finite ZData
Warning: Matrix is singular to working precision.
Warning: Contour not rendered for non-finite ZData
Warning: Contour not rendered for non-finite ZData
And this is the code I am trying to run:
load('cellArray.ma'); % something that I load from my computer to see if the function working.
figure('Name', 'surfc')
Plot3D(cellArray, 'surfc')
figure('Name', 'surf')
Plot3D(cellArray, 'surf')
figure('Name', 'contour')
Plot3D(cellArray, 'contour')
figure('Name', 'abc')
Plot3D(cellArray, 'abc')
Thanks.

댓글을 달려면 로그인하십시오.

답변(0개)

범주

Find more on Matrices and Arrays 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!

Translated by