help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: plot octave graph by running .m file problem


From: Doug Stewart
Subject: Re: plot octave graph by running .m file problem
Date: Wed, 14 Oct 2015 07:43:29 -0400



On Wed, Oct 14, 2015 at 1:04 AM, Manpreet Dhiman <address@hidden> wrote:
Thank you , Allen

Actually I have written wrong values in the range of for loop. Now my graph
is plotted. But not exactly that I want. I am new for Octave and I have
plotted  very simple graph. That way I am facing problem. Now I  modify the
code as you suggest. see:

function k=value(doverA,aoverA)
   up=(1-(aoverA)^2-(2*aoverA*doverA)-(doverA)^2);
   down=(aoverA*doverA+(doverA)^2);
   k=up/down;
end

for aoverA=0:5:100
   for doverA = 0:0.05:0.30
       k=value(doverA,aoverA) %calling of function
       plot([0; aoverA(:,1)], [0;doverA],'-ro')
      hold on
   endfor
endfor

title('Curve Plotting');
xlabel('a/A');
ylabel('d/A');

This code plotting below graph
<http://octave.1599824.n4.nabble.com/file/n4672907/graphoctave.png>

But I want this graph . It means that it will take values from
(0.30,5,0.05,100)

<http://octave.1599824.n4.nabble.com/file/n4672907/IMG_20151013_175059.jpg>

Guide me. I need your advice.





You are calculating k
but  the graph shows k as an independent variable.

What is k ????
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]