LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-28-2004, 05:54 PM   #1
kevinlyfellow
Member
 
Registered: Sep 2003
Distribution: Ubuntu 5.10
Posts: 56

Rep: Reputation: 15
plotting points in scilab


I was wondering how in the world to plot points in scilab. I'm just trying to do a simple monte-carlo distrubution and I like seeing the points.
 
Old 03-10-2004, 05:09 PM   #2
Hano
Member
 
Registered: Sep 2001
Location: Venezuela, Caracas
Distribution: RedHat 9.0
Posts: 196

Rep: Reputation: 30
well, the simplest way to draw vector dats is clear with the following example:

X=[-%pi:0.01:%pi];
Y=sin(X);
draw2d( X , Y );

its just a matter of reading the docs, and asking questions at http://groups.google.co.ve/groups?hl...ys.math.scilab
 
Old 04-01-2004, 11:06 PM   #3
kevinlyfellow
Member
 
Registered: Sep 2003
Distribution: Ubuntu 5.10
Posts: 56

Original Poster
Rep: Reputation: 15
Thanks Hano. Especially for the link, didn't know there was a group for it, but then again there is a group for just about everything
 
Old 03-12-2006, 06:05 PM   #4
munichtexan
Member
 
Registered: Oct 2005
Posts: 74

Rep: Reputation: 15
Hello, I have been reading through the manuals, but unfortunately since I am also not a Matlab user I ran into some problems. I am not a programmer so if my questions are stupid, please bear with me. I am using an optical program for simulations. The university that I am working with have written a bunch of simple programs in Matlab for visualization. I used the matlab2scilab conversion program, but it appears quite a bit does not translate on the following: I have tried various things and I was wondering if someone could clarify the correct syntax to use. File 1 and File 2 are calculated from the optical program and are binary files.

Questions:
1) Is draw2d the correct plot program for this data? What is being plotted is a time average intensity of two different times versus the X position. In other words the x position is in relation to the x distance and the y distance is the average intensity at two different times t and t'. The intensity is plotted at the same y position as the physical dimension of either the quartz or air.
2) Should I use c-axis for both the x and y axis? It was not clear in the manuals.
3) I do not know what the colorbar function is in Matlab. I looked at Matlab manuals, but since I do not use the program was not sure what this is.

A little bit of help would go a long way in understanding how to use Scilab and I would appreciate the help.

Thanks,
MunichTexan - an old dog trying to learn new tricks. :-)

more plotam.m
function [a,b,c] = plotam(file1,file2)
% comment









fp1=fopen(file1);
fp2=fopen(file2);

size1=fread(fp1,3,'long');

size2=fread(fp2,3,'long');

if size1(1)==1
nx=size1(2);
ny=size1(3);
xlab='y axis (nodes)';
ylab='z axis (nodes)';
end

if size1(2)==1
nx=size1(1);
ny=size1(3);
xlab='x axis (nodes)';
ylab='z axis (nodes)';
end

if size1(3)==1
nx=size1(1);
ny=size1(2);
xlab='x axis (nodes)';
ylab='y axis (nodes)';
end


a=fread(fp1,[nx ny],'float');

b=fread(fp2,[nx ny],'float');
c=a.*a+b.*b;

pcolor(c');

shading('flat');


caxis([0 2*average(c)]);
%axis('equal');

colormap('hot');


colorbar;

xlabel(xlab);

ylabel(ylab);

title('<|E|^2>');
fclose(fp1);
fclose(fp2);

more plotam.sci
function [a,b,c] = plotam(file1,file2)

// Ouput variables initialisation (not found in input variables)
a=[];
b=[];
c=[];

// Display warning for floating point exception
ieee(1)

// comment
fp1 = fopen(file1);
fp2 = fopen(file2);
// L.5: No simple equivalent, so mtlb_fread() is called
size1 = mtlb_fread(fp1,3,"long");
// L.6: No simple equivalent, so mtlb_fread() is called
size2 = mtlb_fread(fp2,3,"long");

if size1(1)==1 then
nx = size1(2);
ny = size1(3);
xlab = "y axis (nodes)";
ylab = "z axis (nodes)";
end;

if size1(2)==1 then
nx = size1(1);
ny = size1(3);
xlab = "x axis (nodes)";
ylab = "z axis (nodes)";
end;

if size1(3)==1 then
nx = size1(1);
ny = size1(2);
xlab = "x axis (nodes)";
ylab = "y axis (nodes)";
end;

// L.29: No simple equivalent, so mtlb_fread() is called
a = mtlb_fread(fp1,[nx,ny],"float");
// L.30: No simple equivalent, so mtlb_fread() is called
b = mtlb_fread(fp2,[nx,ny],"float");
c = a .*a+b .*b;
// !! L.32: Unknown function pcolor, original calling sequence used
pcolor(c');
// !! L.33: Unknown function shading, original calling sequence used
shading("flat");
// !! L.34: Unknown function average, original calling sequence used
// !! L.34: Unknown function caxis, original calling sequence used
caxis([0,2*mtlb_double(average(c))]);
//axis('equal');
// !! L.36: Unknown function colormap, original calling sequence used
colormap("hot");
// ! L.37: mtlb(colorbar) can be replaced by colorbar() or colorbar whether colorbar is an M-file or not
// !! L.37: Unknown function colorbar, original calling sequence used colorbar;
colorbar;
// !! L.38: Unknown function xlabel, original calling sequence used
xlabel(xlab);
// !! L.39: Unknown function ylabel, original calling sequence used
ylabel(ylab);
// !! L.40: Unknown function title, original calling sequence used
title("<|E|^2>");
mclose(fp1);
mclose(fp2);
endfunction

Last edited by munichtexan; 03-12-2006 at 06:12 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Developing an application with scilab vrdhananjay Linux - Software 3 12-15-2005 05:26 PM
Beginner on Scilab, matlab script conversion munichtexan Linux - Software 6 12-08-2005 06:42 PM
graph plotting in c/c++ vrdhananjay Programming 1 01-20-2005 08:11 PM
Matlab, Scilab, Octave ... m!k@EL Linux - Software 4 01-01-2005 06:34 PM
Good program for plotting points on a map? Electrode Linux - Software 0 05-30-2004 02:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration