Visualizing a matrix that has matrices that are to a power
Show older comments
Hello Friends,
I am trying to visualize a matrix that is defined by the function T(x,y)=50y/(x^2+y^2+1) where X is in [-3,3] and y is in [-5,5].
The following is my code:
x=linspace(-3,3,15);
y=linspace(-5,5,15);
[X,Y]=meshgrid(x,y);
T=(50*Y)/((X^2)+(Y^2)+1);
figure
surfc(X,Y,T)
shading interp
When I do this Matlab gives me: "Warning: Matrix is singular to working precision."
I am assuming that surfc doesn't like these square matrices?
So I tried changing
x=linspace(-3,3,15);
y=linspace(-5,5,15);
to
x=linspace(-3,3,10);
y=linspace(-5,5,15);
But then my meshgrid matrices are not square and so I cannot put them to a power in my equation T.
Anybody know what I am doing wrong or how to get around this barrier?
Many thanks,
Luke
Accepted Answer
More Answers (0)
Categories
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!