This is the output image of what I'm getting.

You can see the points are not following the curve.

19 views (last 30 days)

Show older comments

The problem is similar to this but I have an x-axis that decreases from 1 to 0 at increments of 0.1 https://www.mathworks.com/matlabcentral/answers/89104-how-to-display-the-coordinate-of-the-point-in-the-figure

for k=1:numel(x)

text(x(k),y(k),['(' num2str(x(k)) ',' num2str(y(k)) ')'])

end

I also need to adjust the window for this but axis won't work because it only applies for increases x-values.

Can someone advise me how to accommodate for these changes?

Walter Roberson
on 24 Jan 2016

Walter Roberson
on 25 Jan 2016

clf

f = [ 0.99 , 0.77, 0.55, 0.33 ];

y1 = @(f)(-14.2 +1000.0) * f.^(1.02 - 1.0) - 1000.0;

y2 = @(newvariable) (1.02 * (newvariable +1000.0) - 1000.0);

y1f = y1(f);

y2y1f = y2(y1f);

y1_0 = fzero(y1,[0,realmax]);

y2y1_0 = fzero(@(x) y2(y1(x)),[0,realmax]);

h = plot( f , y1f, '--ob', f, y2y1f, '--ok', y1_0, 0, '*r', y2y1_0, 0, '*g' );

set(gca, 'xdir', 'reverse')

XY = [f(:), y1f(:); f(:), y2y1f(:); y1_0, 0; y2y1_0, 0];

labels = cellstr([num2str(XY(:,1)),repmat(', ',size(XY,1),1),num2str(XY(:,2))]);

text(XY(:,1), XY(:,2), labels);

legend(h, {'y1(x)', 'y2(y1(x))', 'y1(x) = 0', 'y2(y1(x)) = 0'}, 'location', 'southwest');

Afshin Aghayan
on 8 Oct 2019

you can use this code for displaying any data in the form of [x, y, f(x,y)] or data with coordinate

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

Start Hunting!