Can anyone help me plz ???

조회 수: 1 (최근 30일)
Anas Blue
Anas Blue 2013년 7월 3일
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)

채택된 답변

Wayne King
Wayne King 2013년 7월 3일
편집: Wayne King 2013년 7월 3일
prompt={'Enter The Number Of Lines:'};
title='Draw Line ';
n=inputdlg(prompt);
A = str2num(cell2mat(n));
[x,y] = ginput(A);
plot(x,y)
  댓글 수: 3
Anas Blue
Anas Blue 2013년 7월 4일
Bro can I save the (x, y) in array or each one of them in a single array ??? And thanks
Jan
Jan 2013년 7월 4일
"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];

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Exploration에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by