Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Is there any other way i could make a graph look like a straight line other than changing the limits on the axes by trial and error method?

Asked by Suman Koirala on 9 Apr 2013

I have been asked to get a straight line looking graph for all 4 subplots which I have and they are basically volume vs radius vs area of a sphere. I kind of have it but I was wondering if there's any other way to find it other than manipulating the axes?

this is my program:

r1=[0.1:0.1:100];
A1=4*pi*r1.^2;
V1=(4/3)*pi*r1.^3;
r2=[1:0.1:10000];
A2=4*pi*r2.^2;
V2=(4/3)*pi*r2.^3;
subplot(2,2,1)
plot(V1,r1), xlabel('V'), ylabel('r'), axis([5 50 0 10])
subplot(2,2,2)
plot(A1,r1), xlabel('A'), ylabel('r'), axis([5 50 0 10])
subplot(2,2,3)
plot(V2, A2), xlabel('V'), ylabel('A'), axis([10 100 0 100])
subplot(2,2,4)
plot(r2, A2), xlabel('r'), ylabel('A'), axis([0 50 0 200])

Thanks for the feedback.

0 Comments

Suman Koirala

Products

No products are associated with this question.

0 Answers

Contact us