how to plot curved fitting but the value of x and y must be key in by the user at the command window.

this is the programing that i had done and the output that i want.
x=[249 191 150 139 130 123]';
y=[20 40 60 80 100 120]';
cftool(x,y);
fitresult = fit(x,y,'exp2'); figure; subplot(111), plot(fitresult,x,y); xlabel('distance(pixels)') ; ylabel('molecular weight(mer)');grid;
my problem is,the value x and y must be key in at the command window. so i write another program.this my program..
x= input ('x? '); y=input ('y? ');
cftool(x,y);
fitresult = fit(x,y,'exp2'); figure; subplot(111), plot(fitresult,x,y); xlabel('distance(pixels)') ; ylabel('molecular weight(mer)');grid;
but when i key in the value x and y at the command window,i cannot get the output. can u help me to solve this problem.

Answers (0)

This question is closed.

Tags

Asked:

on 25 Apr 2012

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!