필터 지우기
필터 지우기

matlab showing only points not line. how to connect it?

조회 수: 1 (최근 30일)
APURVAKUMAR SHARADKUMAR JANI
APURVAKUMAR SHARADKUMAR JANI 2018년 9월 16일
댓글: Image Analyst 2018년 9월 16일
function[x]= ap(p)
n=1;
x=0;
while ( n<=p)
sum=0;
m=n;
while (m>0)
sum = sqrt(sum+m);
m=m-1;
end
x= sum;
plot(n,x,'o')
n=n+1;
hold on
grid on
  댓글 수: 1
Priyank Vithani
Priyank Vithani 2018년 9월 16일
편집: Walter Roberson 2018년 9월 16일
x
1 = input('Enter the length of x1 : ');
y1 = input('Enter the length of y1 : ');
x2 = input('Enter the length of x2 : ');
y2 = input('Enter the length of y2 : ');
x = linspace(x1,y1);
y = linspace(x2,y2);
line (x,y)

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

답변 (2개)

ehsan rastgar
ehsan rastgar 2018년 9월 16일
hi dear just change this part
% plot(n,x,'-o') or use plot(n,x,'_o')
  댓글 수: 3
Priyank Vithani
Priyank Vithani 2018년 9월 16일
편집: Walter Roberson 2018년 9월 16일
x1 = input('Enter the length of x1 : ');
y1 = input('Enter the length of y1 : ');
x2 = input('Enter the length of x2 : ');
y2 = input('Enter the length of y2 : ');
x = linspace(x1,y1);
y = linspace(x2,y2);
line (x,y)

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


Walter Roberson
Walter Roberson 2018년 9월 16일
function[x]= ap(p)
n=1;
x=0;
while ( n<=p)
sum=0;
m=n;
while (m>0)
sum = sqrt(sum+m);
m=m-1;
end
x(n) = sum;
n=n+1;
end
plot(1:p,x,'o')
grid on
  댓글 수: 5
Walter Roberson
Walter Roberson 2018년 9월 16일
That input code does not have any apparent relationship to the function you posted. The function you posted expects a single scalar input that is probably intended to be a positive integer.
Image Analyst
Image Analyst 2018년 9월 16일
What are you entering at the prompts?

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

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by