COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### 3D plot #2

• Email
• Follow

Hello,

I'm generating a CSV file for a digital elevation model.
It works fine but I'd like to plot 3D plots (not surface) in Scilab
to check the generated file.

I haven't the finest idea how to do it.

plot3d draw a surface but my X,Y vectors are not monotone

An idea could be to draw dots (points) instead of surface in a 3d
space

I have a look at param3d but it draws curve in 3d space... not dots !

How could I achieve this :

here is the code :

// Generation du maillage d'un terrain
//  definition d'un profil et extrusion

clear

xmin = 0;
xmax = 100;
ymin = 0;
ymax = 100;

// Nb de points du maillage
Nx = 10; // nb d'ecartements en x
Ny = 50; // nb d'ecartements en y

X = [xmin:(xmax-xmin)/(Nx-1):xmax]';
Y = [ymin:(ymax-ymin)/(Ny-1):ymax]';
Z = [];

xlim = 40;
for i=1:Nx,
x = X(i);
if x<xlim then,
z = 0.09 * x;
zlim = 0.09 * xlim;
else
z = 0.02 * (x - xlim) + zlim;
end
Z = [Z ; z];
end

clf
plot2d(X, Z, style=-1); // visu profil

X1 = X;
Y1 = Y;
Z1 = Z;
// extrusion
for i=1:Nx-1,
Y = [Y ; Y1];
end

for j=1:Ny-1,
X = [X ; X1];
Z = [Z ; Z1];
end

// Generation du fichier csv
fd = mopen("mnt2.csv","w"); // ouverture en ecriture d'un fichier
sep = ",";
mfprintf(fd,"%.3f"+sep+"%.3f"+sep+"%.3f"+"\n",X,Y,Z); // sortie
fichier
mclose(fd); // fermeture du fichier

halt

clf
//plot3d(X,Y,Z);
param3d(X,Y,Z);

Kind regards

Sebastien

 0

See related articles to this posting

On Thu, 11 Feb 2010 01:32:44 -0800 (PST), "noone@nowhere.undef"
<s.celles@gmail.com> wrote:

>Hello,
>
>I'm generating a CSV file for a digital elevation model.
>It works fine but I'd like to plot 3D plots (not surface) in Scilab
>to check the generated file.
>
>I haven't the finest idea how to do it.
>
>plot3d draw a surface but my X,Y vectors are not monotone
>
>An idea could be to draw dots (points) instead of surface in a 3d
>space
>
>I have a look at param3d but it draws curve in 3d space... not dots !
>
>How could I achieve this :

I have not tried this with your data -- I'm just now shutting down for
the night -- but you might look at GnuPlot to supplement the plotting
capabilities in Scilab.

--
Rich Webb     Norfolk, VA

 0

So should I understand that Scilab is not able to plot dots in a 3D
space ?

 0

On 11 f=E9v, 10:32, "no...@nowhere.undef" <s.cel...@gmail.com> wrote:
> An idea could be to draw dots (points) instead of surface in a 3d
> space

You may have a look and try with
http://bugzilla.scilab.org/attachment.cgi?id=3D1465
Regards
Samuel

 0

On 13 f=E9v, 14:43, SG <sgoug...@free.fr> wrote:
> On 11 f=E9v, 10:32, "no...@nowhere.undef" <s.cel...@gmail.com> wrote:
>
> > An idea could be to draw dots (points) instead of surface in a 3d
> > space
>
> You may have a look and try withhttp://bugzilla.scilab.org/attachment.cgi=
?id=3D1465
> Regards
> Samuel

The discussion is at http://bugzilla.scilab.org/show_bug.cgi?id=3D6344
The attachment is more complete than the initial patch given in the
description

 0

SG wrote:
> On 13 f�v, 14:43, SG <sgoug...@free.fr> wrote:
>> On 11 f�v, 10:32, "no...@nowhere.undef" <s.cel...@gmail.com> wrote:
>>
>>> An idea could be to draw dots (points) instead of surface in a 3d
>>> space
>> You may have a look and try withhttp://bugzilla.scilab.org/attachment.cgi?id=1465
>> Regards
>> Samuel
>
> The discussion is at http://bugzilla.scilab.org/show_bug.cgi?id=6344
> The attachment is more complete than the initial patch given in the
> description

Thank you. I don't know if it will solve the OP's problem. But
will help me. In midst of unrelated project so have save copy of
both pages for future reference.


 0

> Thank you. I don't know if it will solve the OP's problem. But
> will help me. In midst of unrelated project so have save copy of
> both pages for future reference.

You are welcome. A link to the attachement is given in the discussion,
as comment#1. So you may bookmark only the discussion without loosing
any info.

 0

SG wrote:
>> Thank you. I don't know if it will solve the OP's problem. But
>> will help me. In midst of unrelated project so have save copy of
>> both pages for future reference.
>
> You are welcome. A link to the attachement is given in the discussion,
> as comment#1. So you may bookmark only the discussion without loosing
> any info.

Hoist by my _OWN_ petard ;/
[I've been giving grief to others for referential ambiguity]
One of links referred to was the attachment :)


 0

Hallo

On 13 Lut, 10:55, "no...@nowhere.undef" <s.cel...@gmail.com> wrote:
> So should I understand that Scilab is not able to plot dots in a 3D
> space ?

It seems nobody mentioned "param3d1" - it is possible to use it to
plot a cloud of points.
In principle it plots several trajectories in 3D. The points of
trajectories are given as three separate matrices (x, y and z), data
for individual plots are in columns of the matrices. The last one (z)
must be given as "list(z,color)" where "z" is data-matrix and "color"
is vector defining colors of individual trajectories.
If "x", "y" and "z" will be _row vectors_ (of length n) you will get n
trajctories (plots), each one consisting of single point.
If n is big the plotting will take a lot of time, the use of
"drawlater()" and "drawnow()" helps a little:

drawlater();
param3d1(x,y,list(z,ones(z)))
drawnow();

Regards
AB

 0

noone@nowhere.undef a �crit :
> Hello,
>
> I'm generating a CSV file for a digital elevation model.
> It works fine but I'd like to plot 3D plots (not surface) in Scilab
> to check the generated file.
>
> I haven't the finest idea how to do it.
>
> plot3d draw a surface but my X,Y vectors are not monotone
>
> An idea could be to draw dots (points) instead of surface in a 3d
> space
>

> I have a look at param3d but it draws curve in 3d space... not dots !
>
> How could I achieve this :

simply this way

param3d(X,Y,Z);
p=gce();//get the handle on the just drawn polyline
p.mark_mode='on';//enable the mark drawing (a mark at each given point)
p.line_mode='off';//disable line drawing between given points

Serge Steer
INRIA

 0

> simply this way
>
> param3d(X,Y,Z);
> p=gce();//get the handle on the just drawn polyline
> p.mark_mode='on';//enable the mark drawing (a mark at each given point)
> p.line_mode='off';//disable line drawing between given points

It works with not too many points

with
Nx = 10;
Ny = 50;
it works fine

but with
Nx = 50;
Ny = 50;
it doesn't work !!!!

 0

10 Replies
1221 Views

Similar Articles

11/30/2013 5:50:38 AM
page loaded in 105679 ms. (0)

Similar Artilces:

plot
I've not used graphics.h before. How can I plot a function say y=sin(x) ? In article <1188332437.770998.139350@x35g2000prf.googlegroups.com>, Umesh <fraternitydisposal@gmail.com> wrote: >I've not used graphics.h before. How can I plot a function say >y=sin(x) ? Sorry, graphics.h is not part of the C programming language. There are a number of completely different graphics.h around. You need to consult a reference suitable for your implementation. Poking around a moment, I see an old example that might still be of value for you. Or maybe not, considering all the different graphics.h around. http://www.mycplus.com/Programming-News-Articles.asp?NewsID=33 -- Prototypes are supertypes of their clones. -- maplesoft "Umesh" <fraternitydisposal@gmail.com> wrote in message news:1188332437.770998.139350@x35g2000prf.googlegroups.com... > I've not used graphics.h before. How can I plot a function say > y=sin(x) ? > It's a platform-specific header. I've no idea how it works, but presumably you will need to intialise a graphics display. Then there will almost certainly be a function called something like

plot and matrix
Hi,I have this code.My question is why can't the matrixes z(n),x(n),Y(n),Y1(n) be created in the workspace?Because i want to plot(b,Y) for example and i have an empty figure!Thank you for b=0:0.1:0.2 clear x; clear z; i=1; n=1; z(n,1)=rand; x(n,1)=exprnd(1); while x(n,1)<= b Y(n,1)=z(n,1)-c*n; n=n+1; z(n,1)=rand; x(n,1)=exprnd(1); end Y(n,1)=z(n)-c*n; F=sum(Y)/n; fi=find(z); big=max(fi); value=z(big); Y1(i,1)=value-(c*big) i=i+1; end "nick " <powerman1985@hotmail.com> wrote in message <ie11nh$72j$1@fred.mathworks.com>... > Hi,I have this code.My question is why can't the matrixes z(n),x(n),Y(n),Y1(n) be created in the workspace?Because i want to plot(b,Y) for example and i have an empty figure!Thank you > > for b=0:0.1:0.2 > clear x; > clear z; > i=1; > n=1; > z(n,1)=rand; > x(n,1)=exprnd(1); > while x(n,1)<= b > Y(n,1)=z(n,1)-c*n; > n=n+1; > z(n,1)=rand; > x(n,1)=exprnd(1); > end > Y(n,1)=z(n)-c*n; > F=sum(Y)/n; > fi=find(z); > big=max(fi); > value=z(big); > Y1(i,1)=value-(c*big) > i=i+1; > end you don't have the variable

Update a plot
Hi! I will plot a polar plot, like a pice of a cake. I will plot each line from origo and out at a time. Like this: sweep_number = 1; shot_number = 523; figure(100); axis([-740 740 0 1500]) for i=1:sweep_number for j=1:shot_number pcolor(x(:,1:j+1,i), y(:,1:j+1,i), P(:,1:j+1,i)); shading('interp'); axis([-740 740 0 1500]) hold on; pause(0.001) end end My problem is the speed. It takes too much time to plot all shots. I think that the "hold on" is my problem. Is there another way to update the plot, without using "hold on" ?

The CL plot?
Tim Bradshaw wrote: > I bought my copy of CLtL second hand during a trip to the east coast > of the US in the late 80s. I found it in a curious little bookshop > whose owner was, perhaps, a little more strange and unpleasant than > the owners of second-hand bookshops usually are. I was only learning > Lisp at that time, and perhaps did not realise the significance of > what I'd found. > > The copy was battered and heavily annotated in various hands. The > most important thing I did not discover until my return to the UK - to > Cambridge, coinci

optimizing a plot
i'm having trouble with the following plot im trying to show the difference in the progression of 3 systems but when a certain point is reached it starts to run really slowly. i imagine this is because i am plotting the whole graph at each loop if it just plotted the next step and added it to the plot i think this would solve the problem but i have no idea how to do this or if it is even possible. for i=1:1000 hold on pause(0.1) plot(xb(1:i,1),xb(1:i,2),'b') plot(xc(1:i,1),xc(1:i,2),'g') plot(xd(1:i,1),xd(1:i,2),'r') title('Chuas Double Scroll Attractor') fsize=15; xlabel('x(t)','Fontsize',fsize); ylabel('y(t)','Fontsize',fsize); hold off fixed it after much more trial and error. hold on plot(xb(1,1),xb(1,2),'b') plot(xc(1,1),xc(1,2),'m') plot(xd(1,1),xd(1,2),'r') title('Chuas Double Scroll Attractor') axis([-2.5 2.5 -0.5 0.5]) fsize=15; xlabel('x(t)','Fontsize',fsize); ylabel('y(t)','Fontsize',fsize); zlabel('z(t)','FontSize',fsize); pause for i=2:1000 pause(0.1) plot(xb(i-1:i,1),xb(i-1:i,2

deleting a plot
Hi If I have plotted a new graph (of 1 point) let's say: plot(1,1,'+') how can I delete it using code? yakir sudry wrote: > Hi > If I have plotted a new graph (of 1 point) > let's say: > plot(1,1,'+') > how can I delete it using code? help close -- No I don't want to delete the window. but to delete this specific point I'm plotting on the same figure a few graphs and want to delete 1 of them without repainting them all thanks "yakir sudry" <yakirsudry@gmail.com> wrote in message news:h09c29$gbe$1@fred.mathworks.com... > No > I don't want to delete the window. but to delete this specific point > I'm plotting on the same figure a few graphs and want to delete 1 of them > without repainting them all > thanks Get the handle to the object (either by specifying an output argument on your call to PLOT or using something like FINDOBJ) and then call DELETE on the handle. -- Steve Lord slord@mathworks.com Try unplot http://www.mathworks.com/matlabcentral/fileexchange/2831 MB

Text in plot
I am trying to use 'text' to write something in my plot but after running nothing appears Can any one knows what is the problem ? text(1000,1000,'string') .... or text(5*pi/4,sin(5*pi/4),... ['sin(5*pi/4) = ',num2str(sin(5*pi/4))],... 'HorizontalAlignment','center',... 'BackgroundColor',[.7 .9 .7],... 'Margin',10); "roya olyazadeh" <roya2543@gmail.com> wrote in message <ht0po6$2lh$1@fred.mathworks.com>... > I am trying to use 'text' to write something in my plot > but after running nothing appears > Can any one knows what is the problem ? > > > text(1000,1000,'string') .... > or > > text(5*pi/4,sin(5*pi/4),... > ['sin(5*pi/4) = ',num2str(sin(5*pi/4))],... > 'HorizontalAlignment','center',... > 'BackgroundColor',[.7 .9 .7],... > 'Margin',10); try this plot(0:pi/20:2*pi,sin(0:pi/20:2*pi)) text(pi,0,' \leftarrow sin(\pi)','FontSize',18)

Plot a Cube
Hi, I have a question: how can I plot a 3D cube in matlab? "Bobba Marco" <bobbaNO@mfn.SPAM.unipmn.it> wrote in message <g9rbk6$idc$1@fred.mathworks.com>... > Hi, I have a question: how can I plot a 3D cube in matlab? meh, but one way... yo = unique([-1 -1 -1; perms([1 1 -1]); perms([1 -1 -1]); 1 1 1], 'rows'); yo2 = delaunay3(yo(:,1), yo(:,2), yo(:,3), {'Qt', 'Qbb', 'Qc', 'Qz'} ); tetramesh(yo2, yo) watch line wraps. ~Adam I like this: s=input('side: '); x=[0 1 1 0 0 0;1 1 0 0 1 1;1 1 0 0 1 1;0 1 1 0 0 0]*s; y=[0... to use patch to plot a cube is to define vertices and faces as follows: verts = ([0 0 0;0 1 0;1 1 0;1 0 0;0 0 1;0 1 1;1 1 1;1 0 1]-0.5).*sidelength; %this is of course the x,y,z coordinates of the unit cube's vertices, shifted to center on origin and multiplied by sidelength face = [1 2 3 4;5 6 7 8;3 4 8 7;1 2 6 5;2 3 7 6;4 1 8 5]; %this is, less obviously, the order of connection of vertices for each face. h = patch('Faces',face,'Vertices',verts,'FaceColor','b','EdgeColor','w'); this makes much more sense if you, again, draw a little 3-axes

plot matlab
this is maybe trivial q. when i write code on command windows in FOR loop matlab draw line on plot. when i write code in *.m file on plot window there is no line (only '.' or '*' or 'o'..). i try and '-' or '--' and can't draw solid line or dash. code is trivial: %****************** a=2; b=3; for i=1:1:10; x=a*i+b; plot(i,x); hold('on'); end %****************** i need this for much larger program for calculate some mech. problem and there is lot of plots and for loops. can help me anyone? tnx On 3/27/2011 11:15 AM, Mateja wrote: > this is maybe trivial q. when i write code on command windows in FOR > loop matlab draw line on plot. when i write code in *.m file on plot > window there is no line (only '.' or '*' or 'o'..). i try and '-' or > '--' and can't draw solid line or dash. code is trivial: > %****************** > a=2; > b=3; > for i=1:1:10; > x=a*i+b; > plot(i,x); > hold('on'); > end > %****************** > > i need this for much larger program for calculate some mech. problem and >

plot with structfun
I like to plot my struct with the following code: structfun(@plot,Data) Data is a struct with different trials: eg. size(Data.trial1)=158 1 I like to change the color as in the following code plot(Data.trial1,'r') Can everybody help me? Best, Kai > I like to plot > Can everybody help me? I like .. the way you write. Try this: create an m-file named makeitred, containing function sth = makeitred(x) sth = plot(x,'r') Then write to command window: a = [1,2,3,4,5]; b = [3,4,6,6,4,45,446,4,34]; c = [2,454,555,5]; S.a = a; S.b = b; S.c = c; LHS = structfun(@makeitred,S) I suppose you will like to add a few more commands to the makeitred function, as e.g. save / export your figure, formatting, labeling, etc. You can also specify the function with more than one input. Come with more questions if you get stuck again. Best of luck. "Kai " <sihing_kai@gmx.de> wrote in message <hud7vg$r43$1@fred.mathworks.com>... > I like to plot my struct with the following code: > > structfun(@plot,Data) > > Data is a struct with different trials: > eg. > size(Data.trial1)=158 1 > > I

Plot with origin
Is there a way to include the origin in a plot without specifying the maximum values for the axes? /August -- The competent programmer is fully aware of the limited size of his own skull. He therefore approaches his task with full humility, and avoids clever tricks like the plague. --Edsger Dijkstra On Oct 20, 8:10=A0pm, August Karlstrom <fusionf...@gmail.com> wrote: > Is there a way to include the origin in a plot without specifying the > maximum values for the axes? > > /August > > -- > The competent programmer is fully aware of the limited size of his own > skull. He therefore approaches his task with full humility, and avoids > clever tricks like the plague. --Edsger Dijkstra You could introduce a "dummy" NaN value at the begining and/or end of the data but why don't you want to specify it using axis([]).... ? Regards, Enrique Vidal On 2010-10-20 20:20, Enrique Vidal Sanchez wrote: > On Oct 20, 8:10 pm, August Karlstrom<fusionf...@gmail.com> wrote: >> Is there a way to include the origin in a plot without specifying the >> maximum values for the axes? > > You

Contour plot
I know this topic has been discussed many times, and Ben gave some good suggestions and examples. But I still need help on the contour plot. I am trying to generate a contour plot similar to the contourf function in Matlab. With the x-y projection property, I can get a similar plot, but the x-axis label orientation is toward right instead of up. I looked through all property nodes, there is no way to change it. Also, the axis label looks ugly (too big). Is there any better way to do this? I also tried calling Matlab. But the program will be released as an excutable program. I need to bother...; target="_blank">http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=169880</a> Thanks. I'll check it. Overall I am quite satisfied with the 3D plot of Labview, but my boss doesn't like it. After spending a few days in stand-alone matlab program, I come back to Labview's 3D surface contour plot. There are two many limitations on stand-alone Matlab applications, e.g., which can't load data from an Ascii file. Do you work for NI, Ben? Currently my biggest program with Labview plot is the x-axis label orientation. Also the label text

Plot Sizes
I have been plotting data and am writing a program to save the plots. However, the plot window needs to be maximized in order for the images to have a large enough size for what I want them. SO, is there a command to make their dimensions that large? Basically I want each one of them to fill an 8.5x11 sheet of paper. Thanks! ~Lauren "Lauren Perskie" <Lauren.Perskie@jhuapl.edu> wrote in message news:<eee1de0.-1@webx.raydaftYaTP>... > I have been plotting data and am writing a program to save the plots. > However, the plot window needs to be maximized in order for the > images to have a large enough size for what I want them. SO, is > there a command to make their dimensions that large? Basically I > want each one of them to fill an 8.5x11 sheet of paper. Thanks! > > ~Lauren orient tall

point plot
Hello, I want to plot ony data points, without a line between them. If I am using a call like >> plot(x,y,'LineStyle','.') I get a plot which matches my expectations, but I receive the following warning: Warning: Setting marker type based on 'LineStyle' property 'Marker' and 'LineStyle' have been made separate properties Use 'Marker' property to remove this warning. If I use >> plot(x,y,'Marker','.') the points are connected with a line. So what shall i do? The above message is not very helpful. Michael Michael Salloker wrote: > Hello, > > I want to plot ony data points, without a line between them. > > If I am using a call like > > >> plot(x,y,'LineStyle','.') > > I get a plot which matches my expectations, but I receive the following > warning: > > Warning: Setting marker type based on 'LineStyle' property > 'Marker' and 'LineStyle' have been made separate properties > Use 'Marker' property to remove this warning. > > If I use > > >

slider with plot
Hallo! How can I get this:? When I move the slider along,I want the plot changed without a pushbutton or something like that. I just want that happening interactive. Thanks!

Plot in MatPlotLib
--_000_F9D8DC52CB96E24D8C7AA5F8E9781E881E396702BLRKECMBX23adin_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi all, I have written the types to plot in Matplotlib. #Usage Type 1 plt.plot(t,s) plt.show() #Usage type 2 fig=3Dplt.figure() ax=3Dfig.add_subplot(111) ax.plot(t,s) plt.show() I want difference between these types and other ways in which we can use = plot. Thanks & Regards, Chandru **************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL...=3D"EN-US" link=3D"#0563C1" vlink=3D"#954F72"> <div class=3D"WordSection1"> <p class=3D"MsoNormal">Hi all,<o:p></o:p></p> <p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p> <p class=3D"MsoNormal">I have written the types to plot in Matplotlib.<o:= p></o:p></p> <p class=3D"MsoNormal"><o:p>&nbsp;</o:p></p> <p class=3D"MsoNormal">#Usage Type&nbsp; 1<o:p></o:p></p> <

Plot histogram
Instead of plotting the histogram as bars, I want to plot is as diamonds (i.e a diamond at the top of each bar). How can I do this? "mb " <marit.berger@student.lu.se> wrote in message news:hq4dmf$q96$1@fred.mathworks.com... > Instead of plotting the histogram as bars, I want to plot is as diamonds > (i.e a diamond at the top of each bar). > How can I do this? Call HIST with one or two outputs and then use the regular PLOT function with the appropriate line specification ('d' if you don't want the diamonds connected by lines, 'd-' if you do.) -- Steve Lord slord@mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

plot periodogram
in periodogram spectrum: how can i make the frequency axe in Hz because the default unit in KHZ. I use this code: psdx = psd(spectrum.periodogram,x,'NFFT',length(x),'Fs',10000); "Walid " <walid8421@live.fr> wrote in message <isqbge$852$1@newscl01ah.mathworks.com>... > in periodogram spectrum: how can i make the frequency axe in Hz because the default unit in KHZ. > I use this code: > psdx = psd(spectrum.periodogram,x,'NFFT',length(x),'Fs',10000); Hi Walid, If you look at psdx.Frequencies, they are in Hz. If you want to plot the periodogram in Hz, you can do the following. psdx = psd(spectrum.periodogram,x,'NFFT',length(x),'Fs',10000); plot(psdx.Frequencies,10*log10(psdx.Data)); grid on; xlabel('Hz'); ylabel('Power/Frequency (dB/Hz)'); Hope that helps, Wayne "Wayne King" <wmkingty@gmail.com> wrote in message <isqcvc$boh$1@newscl01ah.mathworks.com>... > "Walid " <walid8421@live.fr> wrote in message <isqbge$852$1@newscl01ah.mathworks.com>... > > in periodogram spectrum: how can i make the frequency axe in Hz because the default

Plot trainstate
Hi guys, I have some problems to understand the meaning of 'Mu' and 'Validation Checks' when I plot my neural Network. Is better to have an high Mu or a lower?? Thanks to all

Plot with nodisplay
Currently I am trying to run matlab in the background of a unix systems with nodisplay and also trying to avoid needing to run an X11 graphics program. The problem is that I need to try and print plots directly to a file and if they display at all the X11 error trips and the program stops. I am trying to do it: matlab -nodisplay < filename.m > output.txt and my plot commands: figure(1) figure('visible','off') plot(generation,min_fit,'rx'); print(figure(1),'-depsc2','FitValues.eps') unfortunately the X11 error is still tripping...; output.txt > > and my plot commands: > > figure(1) > figure('visible','off') > plot(generation,min_fit,'rx'); > print(figure(1),'-depsc2','FitValues.eps') > > unfortunately the X11 error is still tripping. Does anyone have any suggestions? Typing figure(1) before figure('visible','off') is opening a visible figure. If you delete figure(1), it should work fine. cheers, bob-o "Jason" wrote in message <ibbrn0$h24$1@fred.mathworks.com>... > Currently I am trying to run matlab