Plotting in 3d

Answers (2)

Alexander
Alexander on 31 Jul 2020
x = 1:0.1:10;
y = 1:0.1:10;
[X,Y] = meshgrid(x,y);
Z=1./sqrt(X.^2+Y.^2);
imagesc(x,y,Z)

4 Comments

Zilla Tofte
Zilla Tofte on 31 Jul 2020
Why is the x and y=1:0.1:10...what does that mean?
Zilla Tofte
Zilla Tofte on 31 Jul 2020
The picture of that code is just a blue grid...
Alexander
Alexander on 31 Jul 2020
as an example, I plotted x/y in 1 to 10 range. You can substitute with whatever ranges you need. "0.1" is the step for x/y variables. x = 1:0.1:10 creates a vector of number [1 1.1 1.2 ..... 9.9 10].
madhan ravi
madhan ravi on 31 Jul 2020
surf() instead of imagesc()

Sign in to comment.

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Asked:

on 31 Jul 2020

Commented:

on 31 Jul 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!