Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
APURVAKUMAR SHARADKUMAR JANI
Kommentiert: Image Analyst am 16 Sep. 2018
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 Kommentar
Priyank Vithani
Priyank Vithani am 16 Sep. 2018
Bearbeitet: Walter Roberson am 16 Sep. 2018
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)

Melden Sie sich an, um zu kommentieren.

Antworten (2)

ehsan rastgar
ehsan rastgar am 16 Sep. 2018
hi dear just change this part
% plot(n,x,'-o') or use plot(n,x,'_o')
  3 Kommentare
Priyank Vithani
Priyank Vithani am 16 Sep. 2018
Bearbeitet: Walter Roberson am 16 Sep. 2018
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)

Melden Sie sich an, um zu kommentieren.


Walter Roberson
Walter Roberson am 16 Sep. 2018
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 Kommentare
Walter Roberson
Walter Roberson am 16 Sep. 2018
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 am 16 Sep. 2018
What are you entering at the prompts?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by