Can anyone help me plz ???

I wrote this code but I can't plot anything and there
prompt={'Enter Th Number Of Lines:'};
title='Draw Line ';
n=inputdlg(prompt);
A= cell2mat(n);
[x,y] = ginput(A);
plot(x,y)

 Accepted Answer

Wayne King
Wayne King on 3 Jul 2013
Edited: Wayne King on 3 Jul 2013
prompt={'Enter The Number Of Lines:'};
title='Draw Line ';
n=inputdlg(prompt);
A = str2num(cell2mat(n));
[x,y] = ginput(A);
plot(x,y)

3 Comments

Thanks dude
Bro can I save the (x, y) in array or each one of them in a single array ??? And thanks
"title" is a Matlab command and shadowing it by a variable can cause unexpected troubles.
A simplification:
A = sscanf(n{1}, '%d');
You can store x and y in one array:
data = [x, y];

Sign in to comment.

More Answers (0)

Categories

Tags

Community Treasure Hunt

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

Start Hunting!