Substitute all the values in a matrix

I have a matrix like the one shown below. It is a three coordinate system, and I would like to change the values 38,39 and 40 for the values 0,1,2. And after that represent the obtained matrix in a 3D plot.
38 38 0.09
39 38 0.19
40 38 0.12
38 39 0.05
39 39 0.09
40 39 0.34
38 40 0.45
39 40 0.11
40 40 0.23

 Accepted Answer

In this case:
M(:,1:2) = M(:,1:2)-38;
scatter3(M(:,1),M(:,2),M(:,3),M(:,3)*1000,M(:,3),'filled')
HTH

More Answers (0)

Categories

Find more on Get Started with Phased Array System Toolbox 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!