Experiment with the scatter and scatter3 functions
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:12| Question number:7.12
All Answers
total answers (1)
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:12| Question number:7.12
total answers (1)
Ch12Ex7.m
% Investigates the scatter and scatter3 plots
% using random sizes and colors for random points
clf
%Number of points
n = 50;
%Data
x = rand([1 n])*10;
y = rand([1 n])*10;
%Size and color
s = randi([50,1000],1,n);
c = randi([1,64],1,n);
figure(1)
scatter(x,y,s,c,'filled')
title('Random sizes and colors')
%Number of points
n = 50;
%Data
x = rand([1 n])*10;
y = rand([1 n])*10;
z = rand([1 n])*10;
%Size and color
s = randi([50,1000],1,n);
c = randi([1,64],1,n);
figure(2)
scatter3(x,y,z,s,c,'filled')
title('Random sizes and colors')
need an explanation for this answer? contact us directly to get an explanation for this answer