Can anyone help me plz ???

4 views (last 30 days)
Anas Blue
Anas Blue on 3 Jul 2013
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
Anas Blue
Anas Blue on 4 Jul 2013
Bro can I save the (x, y) in array or each one of them in a single array ??? And thanks
Jan
Jan on 4 Jul 2013
"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

Find more on Visual Exploration in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!