# Question:Plotting procedure output

## Question:Plotting procedure output

Maple
Hi, I was trying to plot a graph in Maplet using for this the output of a procedure. I don´t understand way the plotter element don´t show the procedure output. Can anyone help me? Thanks, João Laudares, Brazil Here is the code: > restart;with(linalg):with(stats[statplots]):with(plots):with(CurveFitting): > GSeidel:=proc(a, prec, nmax) > local n, xnew, i, j, k, m, erro, soma: > global xold,x,y,R2,R3,h,X,Y,vetor,xix,z,p,vetor_erro,vetor_iterada,R4,R5: > n:=rowdim(a): > xold:=vector(n,1): > xnew:=vector(n,1): > erro:=1: > vetor_erro:=vector(nmax); > vetor_erro:=0; > vetor_iterada:=vector(nmax); > vetor_iterada:=0; > for j from 1 to nmax do > x:=vector(j); > y:=vector(j); > xix:=vector(nmax); > vetor:=vector(n); > if erro > prec then > #Calculando vetor xnew para iterada j > for i from 1 to n do > soma:=0: > for k from 1 to n do > if i<>k then soma:=soma+a[i,k]*xnew[k]: fi > od: > xnew[i]:=(a[i,n+1]-evalf(soma))/a[i,i]: > od: > for z from 1 to j do > xix[z]:=erro; > od: > for p from 1 to j do > y[p]:=y[j]; > od: > vetor_erro[j]:=erro; > vetor_iterada[j]:=j; > > R2 := convert(xix,'list'); > R3 := convert(y,'list'); > else break > fi: > for k from 1 to n do > erro:=0: > m:=abs(xnew[k]-xold[k]): > if erro <> xold[k]:=xnew[k]: > od: > R4 := convert(vetor_erro,'list'); > R5:= convert(vetor_iterada,'list'); > p:=plots[display]({scatterplot(R4,R5)},view = [0..1000, 0..10],axes=frame); > print(p); > od: > end: > A := linalg[matrix](2,3,[1,2,3,4,5/2,6]); > with(Maplets[Elements]): > maplet2d := Maplet([ > [Button("Plot", Evaluate('PL1' = 'GSeidel(A,0.001,10)') ), Button("OK", Shutdown(['TF2d']))] > ,Plotter['PL1']( plot(undefined, x = 0..2000,y=0..10) )]): > result := Maplets[Display](maplet2d);
﻿